In our case, we plugged the LED into Digital 4. After inserting ’ turnLEDOn(dgtl4); ’ into our teleoperated code, we received the following error -
Error:Undefined procedure ‘turnLEDOn’.
After searching around for a while, I found no topics on Vex Forum concerning this error. Has anyone else had this happen or used these LED’s in the past and ran into similar issues? I’m sure we’re just missing something obvious at this point.
It appears that you’re looking at the documentation for Natural Language - this is not the setting that RobotC is set to by default. You CAN turn RobotC to Natural Language, but I wouldn’t recommend it if you’ve already been using normal RobotC.
Yes, these are natural language functions and are simply wrappers for SensorValue. This is the relevant code from the natural language header file for VEX (although they look backwards to me, ie. lenOn should be 0).
This issue seems more complicated than it should be, so I’m back to ask the code vexperts a few more questions.
The robot currently has a 2-wire extension wire plugged into the correct red & black pin ports. This wire is plugged into digital 4, and the LED is plugged into the 2-wire extension. Whenever the robot is turned on, the LED immediately lights up.
Hmm, I plug them into signal and +5V (white and red), I don’t think the VEX leds can be plugged into black and white as they use two adjacent pins, I only have home brew ones so would need to check on that. When the signal goes low then led should light. There is a 1K series resistor (from what I remember) in the signal line to limit current. RobotC may invert the logic so you need to experiment.
You guys are great, moving the 2-wire connector did the trick. I should have read the LED specs a little more closely, but this is our first time trying to use them for driver feedback purposes. We’ll get a video up soon & will make sure to document this for anyone else that has issue with them in the future. Thanks again for the help!