Shop OBEX P1 Docs P2 Docs Learn Events
LED Lighting Controller With a MAX6969 — Parallax Forums

LED Lighting Controller With a MAX6969

sam_sam_samsam_sam_sam Posts: 2,286
edited 2010-03-08 03:29 in BASIC Stamp
I want to thank LEDboy For his Night Rider Code which I use some of that code for this· idea.gif
I had some time to Play with an·idea.gif·about a lighting controller with a MAX6969
I think that this idea.gif·should work very well I will use all output when I··built a·Protoboard for·this Project will use·white LEDs
I going to run this routine for the Next 5 days and see how well it work
The Demo board that I made is with PINK Led which are cool but not a good night light
What I have to work on is the switch encoder to work the Lighting Control Level·
·One Note the set current is set to 20 millamp using·Three ·330 ohms resisters to get 990 ohms
' =========================================================================
'
'   File...... MAX6969 Test Demo Code
'   Purpose... Night LED  Lighting Controller
'   Author.... sam_sam_sam
'   E-mail.... [url=mailto:sam1030@comcast.net]sam1030@comcast.net[/url]
'   Started... 3-7-10
'   Updated...
'
'   {$STAMP BS2px}
'   {$PBASIC 2.5}
'
' =========================================================================

' -----[noparse][[/noparse] Program Description ]---------------------------------------------

' -----[noparse][[/noparse] Revision History ]------------------------------------------------

' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
DIN        CON    9
CLK        CON    8
LE         CON    7
' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
'
'                                       MAX6969 Control Bits One Bank of at a time LED Lights
'
ONE           CON %0000000000000001
TWO           CON %0000000000000010
THREE         CON %0000000000000100
FOUR          CON %0000000000001000
 
'                                        Control Light Level  ( More than ONE Bank )
L_ONE         CON %0000000000000001
L_TWO         CON %0000000000000011
L_THREE       CON %0000000000000111
L_FOUR        CON %0000000000001111
L_ALL         CON %0000000000011111

NONE          CON %0000000000000000
' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
'
IDX        VAR     Nib
Value      VAR     Word
'
' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------

' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
'
 LOW LE
'
' -----[noparse][[/noparse] Program Code ]---------------------------------------------------
 
Main:
 DO
 GOSUB Level_None
 PAUSE 1000
 GOSUB Level_1
 PAUSE 1000
 GOSUB Level_2
 PAUSE 1000
 GOSUB Level_3
 PAUSE 1000
 GOSUB Level_4
 PAUSE 1000
 LOOP
 
' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
 Level_None:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, NONE]
 PULSOUT LE, 5
 RETURN
 Level_1:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, L_ONE]
 PULSOUT LE, 5
 RETURN
 Level_2:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, L_TWO]
 PULSOUT LE, 5
 RETURN
 Level_3:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, L_THREE]
 PULSOUT LE, 5
 RETURN
 Level_4:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, L_FOUR]
 PULSOUT LE, 5
 RETURN
   RETURN
 Level_ALL:
 SHIFTOUT DIN, CLK, MSBFIRST, [noparse][[/noparse]value\16, L_ALL]
 PULSOUT LE, 5
 RETURN

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 3/11/2010 11:42:51 PM GMT
Sign In or Register to comment.