Noob rgb led question


#1

im trying to set up a rgb led in a seimitsu ball top and i have no clue what kind of chip to use. im trying to set it up so that if the ball is at rest the led is blue, if its straight out its green, and if its off on a diagonal its red. power source is 5v (usb). any help is greatly appreciated


#2

ok so ive figured out that i need a pic controller of some kind. the controller would need to be set so that if pi 1 and pin2 = 0 then set pin 3 to 1. if pin 1 or pin 2 are set to 1 independently then pin 4 = 1. if pin 1 and pin 2 are both set to 1 at the same time then pin 5= 1. does this make sense to anyone other than me?


#3

If you’re willing to wait a bit, this sounds perfect for an FGWidget, but I’m too swamped at the moment to put it up yet. If not, a single 4 input NAND gate (depending on if its a common anode or common cathode LED) would take care of the color in neutral, four two input NAND gates for the diagonals, and one other inverter for the cardinal directions (which could probably be made out of the spare 4 input NAND on the chip) could take care of this, but you may have to adjust your colors so that neutral and single directions are a primary color and the diagonal is a secondary color.
Or write your own code for a microcontroller, or wait for an FGWidget.


#4

im prolly going to wait on the FGWidget since i know jack about circuits and the last time i wrote any kind of code was atleast 5 years ago in PICbasic. with the fgwidget would i be better off with a common cathode or annode leds?


#5

it can be made to work either way.