- October 29th, 2013, 12:31 pm#465371
Alright party people, only two days until Halloween! I've had a handful of people contact me asking for my Arduino code and I haven't written a thread about it yet, so here it is.
First of all, my code isn't perfect. Proton pack lights were my first reason to use Arduino, so I learned just enough to write a code sketch that worked for me, using only LEDs and resistors (no other timers.) I have a sketch for UNO and for MEGA. Neither is screen accurate, and there is undoubtedly better code out there, but I don't mind sharing mine to those who might find it useful.
Here are a couple reasons why you might want to use Arduino for proton pack lights in light of the drawbacks I've listed above:
1. You are in a pinch and you really need a solution using parts you can find locally... today.
2. Like me, you are really into DIY (doing things the hard way, even if they will be less perfect, because it's a pride of the build thing.)
3. You want a starting point for writing a more complex light code.
I have two sets of code, one for Arduino UNO/Duemilinove and one for Arduino MEGA. I'll do my best to outline the channels for each, but I have not drawn any diagrams, so do your best to follow my descriptions.
NOTES ON SOUND AND POWER:
Good luck and have fun!
________________________________________________________________________________________________
LESS ACCURATE CODE FOR UNO/DUEMILINOVE
Download code here: http://www.portlandghostbusters.com/Pac ... ackUNO.ino
Channel 1 - Wand tip flasher (flash runs constantly in code, wire your switch on this circuit to activate/deactivate)
Channel 2 - Power Cell
Channel 3 - Power Cell
Channel 4 - Power Cell (wire any flashing wand lights to channel 4 or 5 for a steady blink)
Channel 5 - Power Cell
Channel 6 - Power Cell
Channel 7 - Power Cell
Channel 8 - Unused (Wanna get creative? write some code for channel 8 or 9 and do what you want!)
Channel 9 - Unused
Channel 10 - Cyclotron
Channel 11 - Cyclotron
Channel 12 - Cyclotron
Channel 13 - Cyclotron
________________________________________________________________________________________________
MORE ACCURATE CODE FOR MEGA(though still not totally screen accurate, no switching modes)
Download code here: http://www.portlandghostbusters.com/Pac ... ckMEGA.ino
Channel 2 - Always on (wire any LEDs that you want solid on to this channel)
Channel 3 - Wand tip flasher (flash runs constantly in code, wire your switch on this circuit to activate/deactivate)
Channel 5 - Power Cell
Channel 6 - Power Cell
Channel 7 - Power Cell
Channel 8 - Power Cell
Channel 9 - Power Cell
Channel 10 - Power Cell
Channel 11 - Power Cell
Channel 12 - Power Cell
Channel 13 - Power Cell
Channel 14 - Power Cell
Channel 15 - Power Cell
Channel 16 - Power Cell
Channel 17 - Power Cell
Channel 18 - Power Cell
Channel 19 - Power Cell
Channel 20 - Wand Bar Graph
Channel 21 - Wand Bar Graph
Channel 22 - Wand Bar Graph (wire any flashing wand lights to channel 22 for a steady blink)
Channel 23 - Wand Bar Graph
Channel 24 - Wand Bar Graph
Channel 25 - Cyclotron
Channel 26 - Cyclotron
Channel 27 - Cyclotron
Channel 28 - Cyclotron
First of all, my code isn't perfect. Proton pack lights were my first reason to use Arduino, so I learned just enough to write a code sketch that worked for me, using only LEDs and resistors (no other timers.) I have a sketch for UNO and for MEGA. Neither is screen accurate, and there is undoubtedly better code out there, but I don't mind sharing mine to those who might find it useful.
Here are a couple reasons why you might want to use Arduino for proton pack lights in light of the drawbacks I've listed above:
1. You are in a pinch and you really need a solution using parts you can find locally... today.
2. Like me, you are really into DIY (doing things the hard way, even if they will be less perfect, because it's a pride of the build thing.)
3. You want a starting point for writing a more complex light code.
I have two sets of code, one for Arduino UNO/Duemilinove and one for Arduino MEGA. I'll do my best to outline the channels for each, but I have not drawn any diagrams, so do your best to follow my descriptions.
NOTES ON SOUND AND POWER:
- [A.] Either of these will work with any sound board while using DPDT switches. (Many sound boards do not require DPDT)
- [B.] Because arduino takes a couple seconds to boot, you may want the board power on a hidden switch. Using that configuration with your "power up" switch in the GROUND side of the circuit for ALL LEDs will give the effect that all is powering up with the flip of the switch (because you have already booted the Arduino with your secret switch) You really need to run a single ground back from the wand anyway to save wire space in your tube, putting your pack ground through there also only adds one wire and gives the effect of the entire pack coming on with one wand switch.
- [C.] The info here assumes you know enough about circuits to figure this out. I'm not going to get into what you will need on each circuit. I don't know what LEDs or resistors you have available, so I'll ask you make those calculations youself, thanks.
Good luck and have fun!
________________________________________________________________________________________________
LESS ACCURATE CODE FOR UNO/DUEMILINOVE
Download code here: http://www.portlandghostbusters.com/Pac ... ackUNO.ino
Channel 1 - Wand tip flasher (flash runs constantly in code, wire your switch on this circuit to activate/deactivate)
Channel 2 - Power Cell
Channel 3 - Power Cell
Channel 4 - Power Cell (wire any flashing wand lights to channel 4 or 5 for a steady blink)
Channel 5 - Power Cell
Channel 6 - Power Cell
Channel 7 - Power Cell
Channel 8 - Unused (Wanna get creative? write some code for channel 8 or 9 and do what you want!)
Channel 9 - Unused
Channel 10 - Cyclotron
Channel 11 - Cyclotron
Channel 12 - Cyclotron
Channel 13 - Cyclotron
________________________________________________________________________________________________
MORE ACCURATE CODE FOR MEGA(though still not totally screen accurate, no switching modes)
Download code here: http://www.portlandghostbusters.com/Pac ... ckMEGA.ino
Channel 2 - Always on (wire any LEDs that you want solid on to this channel)
Channel 3 - Wand tip flasher (flash runs constantly in code, wire your switch on this circuit to activate/deactivate)
Channel 5 - Power Cell
Channel 6 - Power Cell
Channel 7 - Power Cell
Channel 8 - Power Cell
Channel 9 - Power Cell
Channel 10 - Power Cell
Channel 11 - Power Cell
Channel 12 - Power Cell
Channel 13 - Power Cell
Channel 14 - Power Cell
Channel 15 - Power Cell
Channel 16 - Power Cell
Channel 17 - Power Cell
Channel 18 - Power Cell
Channel 19 - Power Cell
Channel 20 - Wand Bar Graph
Channel 21 - Wand Bar Graph
Channel 22 - Wand Bar Graph (wire any flashing wand lights to channel 22 for a steady blink)
Channel 23 - Wand Bar Graph
Channel 24 - Wand Bar Graph
Channel 25 - Cyclotron
Channel 26 - Cyclotron
Channel 27 - Cyclotron
Channel 28 - Cyclotron