How to let the LED to light up??

Hi,currently i using the vex controller ,3pin wire to connect to the LED.
When i compiled and download the program to the vex controller the LED does not light up. I even set the controller configuration to digital port 1.

This is the program that i do:

#include “Main.h”

void main (void)
{
int port;

while(1)
{
SetDigitalOutput(1,1);
Wait(5000);
}
}

*** Please kindly give me some advise… will be much appreciate… Thanks

try a motor port, that works for me.
maby the led is in backwards

I agree with VEXROCKS… Unless you LED is Bi-Directional, you might have it in backwards…

Also make sure you have a resistor in series with the LED, the Potential Current of the Vex Controller will Burn Out you LED if you connect it directly… For Example see the page Light Emitting Diodes.

Hi,
i try yr method by putting the 3-pin wire to a motor port. The LED can able to light up…

But now , How am i able to set the LED to zero== mean off the light??

In the EASY C software, I using the command of “Set DigitalOuput(1,0)”, but when it compile and download, the LED only can light up… but it can’t off when set to zero.

Thanks alot would give me some advise…:stuck_out_tongue:

The Motor Port has the Full Battery Voltage available on one pin, Ground on another and the Control line on the Third, which is Pulse Width Modulation (PWM) . You most likely have the LED on the Full Battery Voltage, which you can not control.

“Set DigitalOuput(1,0)” does not control the Motor Ports, only the Analog/Digital Ports, set for Digital Output…

You might try using the SetPWM() function to control the output to the motors to see if that will set your LED to be on/off… But if you have it Directly connected to the Battery, this still won’t work.

BTW, have you read the LED (Light Emitting Diode) Information thread???

Hi, is it possible to let the DigitalOutput to produce a Logic “1” and Logic “0” at a certain timing?

Currently, i try on few methods but some how it still can’t be able to work.

First steps, I use vex controller connect to the battery
Second step: I am setting Analog/Digital Port 8 as an output port.

When compile and download to the vex controller, the LED does not light up.
There is no signal transmit to the LED.

According to your suggestion, is to to SETPWM() function?? I using EASY C 2.X… How am i able to set the PWM function??

Is there any other solution to let the LED to light up in logic “1” and logic “0” with a certiain timing?

I need some advise…