PDA

View Full Version : Solved LED Lighting Controller With a MAX6969



sam_sam_sam
03-08-2010, 11:29 AM
I want to thank LEDboy For his Night Rider Code which I use some of that code for this· http://forums.parallax.com/images/smilies/idea.gif
I had some time to Play with an·http://forums.parallax.com/images/smilies/idea.gif·about a lighting controller with a MAX6969
I think that this http://forums.parallax.com/images/smilies/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.... sam1030@comcast.net (mailto:sam1030@comcast.net)
' Started... 3-7-10
' Updated...
'
' {$STAMP BS2px}
' {$PBASIC 2.5}
'
' ================================================== =======================

' -----[ Program Description ]---------------------------------------------

' -----[ Revision History ]------------------------------------------------

' -----[ I/O Definitions ]-------------------------------------------------
DIN CON 9
CLK CON 8
LE CON 7
' -----[ 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
' -----[ Variables ]-------------------------------------------------------
'
IDX VAR Nib
Value VAR Word
'
' -----[ EEPROM Data ]-----------------------------------------------------

' -----[ Initialization ]--------------------------------------------------
'
LOW LE
'
' -----[ 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

' -----[ Subroutines ]-----------------------------------------------------
Level_None:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, NONE]
PULSOUT LE, 5
RETURN
Level_1:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, L_ONE]
PULSOUT LE, 5
RETURN
Level_2:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, L_TWO]
PULSOUT LE, 5
RETURN
Level_3:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, L_THREE]
PULSOUT LE, 5
RETURN
Level_4:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, L_FOUR]
PULSOUT LE, 5
RETURN
RETURN
Level_ALL:
SHIFTOUT DIN, CLK, MSBFIRST, [value\16, L_ALL]
PULSOUT LE, 5
RETURN

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·http://forums.parallax.com/images/smilies/idea.gif·that you may have and all of your time finding them http://forums.parallax.com/images/smilies/smile.gif

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 3/11/2010 11:42:51 PM GMT