Quote:
Stolen from The_Robot.pdf, page 14
3.3.2 Sensor Inputs on the Operator Interface
....
The +12 Vdc LEDs may be connected between +5Vdc and Ground or between an LED output
and Ground to serve as a visual indicator to the robot operators. This can be helpful during a
competition match when a robot operator may not have a good view of the Operator Interface.
CAUTIONS
Connect switches between a switch input and Ground. Do not use lighted switches with
the Operator Interface unless the light is disabled.
|
You can still use these LED outputs manually, and perhaps with even greater use, than an illuminated switch, because you can trick around with them in the programming, rather than just having them on or off in conjunction with a switch. Each LED output (except for the Basic Run LED) is shared between the LEDs physically inside of the OI and a pin on either one of ports 1 and 3.
Code:
'Code exerpt from the 2003 default code, 2.0 and 2.5 versions.
Output 7 'define Basic Run LED on RC => out7
Output 8 'define Robot Feedback LED => out8 => PWM1 Green
Output 9 'define Robot Feedback LED => out9 => PWM1 Red
Output 10 'define Robot Feedback LED => out10 => PWM2 Green
Output 11 'define Robot Feedback LED => out11 => PWM2 Red
Output 12 'define Robot Feedback LED => out12 => Relay1 Red
Output 13 'define Robot Feedback LED => out13 => Relay1 Green
Output 14 'define Robot Feedback LED => out14 => Relay2 Red
Output 15 'define Robot Feedback LED => out15 => Relay2 Green
Say you wanted to have the red PWM1 LED light up whenever you press the port1 trigger. Here's all you'd have to do, if my mind doesn't fail me entirely:
In the default code for PBASIC 2.0 (2.5 doesn't need it, with the advent of the SELECT CASE statement, but that's very interesting, as well), they do some interesting things with the modulus operator, and MIN and MAX to make the various LEDs light up when the PWM1 or PWM2 values are (close to being) maxed or minned (is that a word?) out.
As a side note, during the WRRF's Programming Workshop, before Kickoff, one of the tasks for people to complete was to make a rate display for a PWM output, both forwards, using the green LEDs, and backwards, using the red LEDs. It was very fun to just watch what people were able to do with these LEDs, seeing as how I was staffing the event (with Ken Krieger (formerly of 192, currently of WRRF) in the lead, and Mark Whitehouse (formerly of 232 and 814) as a fellow assistant.
Fun stuff.