Need help in Driving LED Array
Gogs
Posts: 19
I have just started with the Stamp2 and have been looking to dim a 21 bit array of 5mm white ultra bright LEDS. I have already completed a program with two switches and two low power red LEDS. One·Switch for increase brightness using the BUTTON command and second switch for decrease brightness. This works and I am pleased.
Switch1· - RA8
Switch2· - RA9
CNTRL Signal ·0UT - PIN0
However I know the Stamp's I/O is limited·with how many leds·you can drive. Also I wish the lighting array to be on a seperate voltage supply to the Stamp.
However I wish to·know what type of Transistors or FET's·to use to drive a 21·white LED array. I wish to use the signal coming from·Pin0 of the Stamp.
Can anyone give Help.
Switch1· - RA8
Switch2· - RA9
CNTRL Signal ·0UT - PIN0
However I know the Stamp's I/O is limited·with how many leds·you can drive. Also I wish the lighting array to be on a seperate voltage supply to the Stamp.
However I wish to·know what type of Transistors or FET's·to use to drive a 21·white LED array. I wish to use the signal coming from·Pin0 of the Stamp.
Can anyone give Help.
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support
One pin could be used for several transistors.
If so the max output of this is 500ma so I could use two I/O pins and share the outputs to two arrays.
You think this is the way?
'**********************************************************
' Program :·
' Description :· Light Dimmer
' For :··· i-Stamp2P
' Hardware :· Connect LED to P0
'··· Connect active low switch "INC" to P9
'··· Connect active low switch "DEC" to P8
'**********************************************************
'{$STAMP BS2p}
LED_STEP· VAR Byte······· ' Define Byte variable to keep current step
SW_VAR1··· VAR Byte······· ' Define Byte variable to use with BUTTON command
SW_VAR2··· VAR Byte······· ' Define Byte variable to use with BUTTON command
··· INPUT 8········· ' Make P8 as input
··· INPUT 9········· ' Make P9 as input
··· OUTPUT 0······· ' Make P0 as output
··· LED_STEP=0······· ' Clear state to 0
LOOP:··· PWM 0,LED_STEP,5
··· BUTTON 8,0,50,10,SW_VAR1,1,DEC_LIGHT
··· BUTTON 9,0,50,10,SW_VAR2,1,INC_LIGHT
··· GOTO LOOP
DEC_LIGHT:· IF LED_STEP=0· THEN LOOP··· ' Check min value
··· LED_STEP=LED_STEP-1····· ' Decrease brightness
··· GOTO LOOP······· ' Goto loop
INC_LIGHT:· IF LED_STEP=255· THEN LOOP··· ' Check max value
··· LED_STEP=LED_STEP+1····· ' Increase brightness
··· GOTO LOOP······· ' Goto loop
Cheers.