View Single Post
  #11   Spotlight this post!  
Unread 15-02-2013, 19:22
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Programming RGB lighting

To actually control the color of these LEDs, you will have to manually generate the duty cycle for each color in your code using the generic duty cycle (0-100%) functionality to three output pins on the Digital Sidecar (one for each primary color). In essencse, you replace the giant control box on these LED light strips with the FRC control system, and wire directly into the four wires going into the LED light strip.

In addition, the signal pins on the DSC will likely not be able to provide enough current for lighting bright LEDs; in this case you have to use a signal amplifier, such as a homebrew solution using transistors and other discrete components or a COTS solution such as s solid-state relay. Mechanical relays (such as a Spike) will likely not be able to switch fast enough.

Edit:
To actually pink which color you want to generate, look up HTML hexadecimal color charts. Hexadecimal is a base-16 number system, where 0-9 are the same, but A=10, B=11, and so on until F=15. So for example, FF in hexadecimal would be 255. The sequence is 2 digit red, 2 digit green, 2 digit blue, so the hexadecimal color #FF6600 is 255 (out of 255) red, 102 (out of 255) green, and 0 blue.

To convert these three numbers to a generic duty cycle, divide by the large possible number (255). So it becomes

Red: 100%
Green: 40%
Blue: 0%

Which will generate the color orange.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.

Last edited by artdutra04 : 15-02-2013 at 19:28.
Reply With Quote