This has been finished for quite some time but I finally got around to completing the video and didn't want to post on here until I had the video uploaded to youtube.
Here is the video...
The flash animation was done with the PIC and I used the Amicus IDE. This code is condensed from the actual code I uploaded to the PIC and I have not tested it but it should be fine. I noticed repetitive code in my original that was not necessary.
Code: Select all
'KISS logo - annimated sequence
'Set four ports to be used as outputs for the KISS logo
Dim LED0 As PORTB.0
Dim LED1 As PORTB.1
Dim LED2 As PORTB.2
Dim LED3 As PORTB.3
Dim flash As Dword 'Create a word variable that will be used as a delay
While 1 = 1 'Never end
Dim returnToRepeat As Byte 'Create a byte variable
Dim flashRoutine As Byte 'Create another...
returnToRepeat = 2 'Set the first variable so a repeat sequence will run X number of times
flashRoutine = 6 'Set the second variable so the entire routine will X number of times
'Main Program:
loopSequence: 'Label to be used to loop through a flashing sequence
Repeat
High LED0 'Set LED0 high
For flash = 0 To 150000 : Next 'Create delay without using library call
Low LED0 'Set LED0 low
High LED1 'Set LED1 high
For flash = 0 To 150000 : Next 'Create delay without using library call
Low LED1 'Set LED1 low
High LED2 'Set LED2 high
For flash = 0 To 150000 : Next 'Create delay without using library call
Low LED2 'Set LED2 low
High LED3 'Set LED3 high
For flash = 0 To 150000 : Next 'Create delay without using library call
Low LED3 'Det LED3 low
Dec returnToRepeat 'Decrement the repeat variable and return to do it again...
Until returnToRepeat = 0 'until it has been decremented to zero
returnToRepeat = 2 'Reset variable returnToRepeat
Repeat 'Repeat another sequence, only this time we will turn on all the LED's at the same time...
High LED0
High LED1
High LED2
High LED3
For flash = 0 To 150000 : Next 'Hold them for a few...
Low LED0 'Now turn them all off again...
Low LED1
Low LED2
Low LED3
For flash = 0 To 150000 : Next 'Hold them for a few...
Dec returnToRepeat 'Decrement the repeat variable and return to do it again...
Until returnToRepeat = 0 'until it has been decremented to zero
returnToRepeat = 2 'Reset variable returnToRepeat
Dec flashRoutine 'Decrement the flashRoutine variable
If flashRoutine > 0 Then loopSequence 'Return to the beginning of the loop sequence if the flash routine is not finished
stayOn: 'If the flash routine is satisfied, then turn on all lights indefinitely
High LED0
High LED1
High LED2
High LED3
GoTo stayOn
Wend 'END... No interupt needed, just reset the microcontroller to start over!
http://learn.adafruit.com/rgb-led-strips/overview
Here they give you an overview, a schematic of the LED strips, how much current they will draw per meter, wiring them up, breadboarding a circuit, and the code to run them. The code is not as extravagant as other code I have seen, but it is simple enough to run through the colors and modify if you want to.
Anyway, sorry it took so long for me to finally respond but I have been busy with several other non-programming related projects, work, and life...
I also found a nice tutorial for beginners using the Amicus IDE, but I noticed there is no discussion for that on this forum so maybe I'll post another thread here in the PICnDuino area for those who are interested.
Enjoy,
Stacy