Using VEX LEDs

Our team is confused on how to use the VEX LEDs. We want to plug them into a digital I/O port, but the ports are all 3-wire, whereas the LEDs are 2-wire. How do we plug them in to the ports?

Also, are we correct in assuming that the value 1 is lit, and that 0 is unlit?

You plug LEDs into a digital I/O port just as you would a bumper switch or limit switch. Make sure the aligning tab is facing the right way.

It is the opposite.
Setting the output to 0 (Low) turns the LED On and setting the output to 1 (High) turns the LED Off.

They only use two of the three connections, the center one which is +5V and the “signal” connection that turns them on and off. The 0V connection to the outside of the cortex is not used. To turn them on the “signal” (ie. the digital output) is set to 0, to turn them off the “signal” is set to 1. ROBOTC does this inversion for you if you set the digital output port to be a VEX LED. So then you send 1 (or true) to turn them on.

So we put the LED on a 2-wire extension and plug that into the inner 2 connections of the port?

Some pictures to explain.

If you plug it into the cortex, it’s like this (ignore the big green led behind)

[ATTACH]6655[/ATTACH]

Compare it to a 3 wire extension cable you can see the orientation of the connector, it lines up with the red and white wires.

[ATTACH]6658[/ATTACH]

So if you want to extend it plug into the other end like this.

[ATTACH]6661[/ATTACH]

You could use a 2 wire extension, just make sure to connect the right way.
led0.jpg
led1.jpg
led2.jpg

Okay, I understand now. Thanks!

I am currently trying to get the LEDs to work on my robot, but my team can’t find the commands to do so. We have robot C 4.0 I believe, and we don’t have the turnLEDon command.:confused:

You can have a controller button turn it on by set digital output to 1 if this button is pressed.

configure the digital port you want to use to VEX LED the motors and sensors setup:

then use


SensorValue[name]=1;

to turn the LED on, and


SensorValue[name]=0;

to turn it off

How did you program the big green one? i have a pack of LEDs with only 2 pins on them. they are all single color and I want to know how to wire, program and mount them in different places on the robot.

The big green LED in that picture is not competition legal (AFAIK) but you would program it in the same way as a standard VEX led, set the port as digital output and then turn it on or off.

Ok, thanks. Would you use a 2 wire extender cable if you wanted to make it reach farther?

yes, or a three wire, just make sure to use 5V (center pin) and the signal pin (inside, nearest to VEXnet key) otherwise you will have too much current flowing through the led and possibly damage it.