« Week 2: Spacial Design | Main | Perspective Model »
September 20, 2005
Electronic Push Button Menorah
I was waiting for my bulk parts from Jaemco to arrive so I could build something interesting with levers and switches when I realized I wasn't thinking about my work the right way. The goal here isn't to neccsarily build a gizmo but to incorporate technology into the everyday. So I went home to see what I had lying around and the first thing I saw was a menorah which was a great fit since we are playing with LEDs.

I've built out the menorah on the breadboard with the intention of embedding it into an old menorah with a broken music box base. The old mechanisms were analog and I could make the menorah digital with my new circuit.

The menorah starts with all nine lights off. As you hold down the button the shamesh and the first light turn on. If you keep on holding down the button the lights slowly turn on one by one until they are all on. Then the mechanism cycles.

Specs:
A push button (stateless switch) will cycle through all the different light settings. The push button is on portc.2. The LEDs can be mounted on an analog (candles + fire) menorah.
The shamesh, the center light, will light with the first light and stay lit.
'// shamesh (center light)
output portb.7
'// memory slots & slights (total of 16)
output portb.6
output portb.5
output portb.4
output portb.3
output portb.2
output portb.1
output portb.0
output portd.2
input portc.2
main:
'// init
'// Going in a CLOCKWISE U
'// Shamesh RB7. the shaemsh is initially off
LOW portb.7
LOW portb.6
LOW portb.5
LOW portb.4
LOW portb.3
LOW portb.2
LOW portb.1
LOW portb.0
LOW portd.2
LOW portc.2
startagain:
'// Light
'// 1 - RB6
'// 2 - RB5
'// 3 - RB4
'// 4 - RB3
'// 5 - RB2
'// 6 - RB1
'// 7 - RB0
'// 8 - RD2
'// if the button has been pressed
if portc.2 = 1 then
'//i don't think there is an elseif
'// first is the last one on? if so turn them all off
if portd.2 = 1 then
LOW portb.7
LOW portb.6
low portb.5
low portb.4
low portb.3
low portb.2
low portb.1
low portb.0
LOW portd.2
goto bottom
ENDIF
'// now just one at a time, moving backwards
if portb.0 = 1 then
high portd.2
goto bottom
ENDIF
if portb.1 = 1 then
high portb.0
goto bottom
ENDIF
if portb.2 = 1 then
high portb.1
goto bottom
ENDIF
if portb.3 = 1 then
high portb.2
goto bottom
ENDIF
if portb.4 = 1 then
high portb.3
goto bottom
ENDIF
if portb.5 = 1 then
high portb.4
goto bottom
ENDIF
if portb.6 = 1 then
high portb.5
goto bottom
ENDIF
'// if we made it this far, nothing is lit turn the first one on
HIGH portb.7
HIGH portb.6
low portb.5
low portb.4
low portb.3
low portb.2
low portb.1
low portb.0
LOW portd.2
ENDIF
bottom:
pause 500
goto startagain
Posted by mb2811 at September 20, 2005 05:23 AM