For review.
The program works great. I was wondering how to keep it functioning the same but maybe clean up the code any hints would be great.
I think that I am finished with the schematic also. (Dippy, I think I made the relay better also)
Any more input would be great.
Thanks so much.
Doug H.
The program works great. I was wondering how to keep it functioning the same but maybe clean up the code any hints would be great.
Code:
#picaxe14m
symbol UVLEDTop = 0
symbol LEDTop =1
symbol UVLEDBottom =2
symbol LEDBottom =3
symbol Motor = 4
symbol Buzzer = 5
Init: let b0 = 0
Main:
if pin3 = 1 then Add
goto main
Add:
pause 100 ‘short delay
if b0 = 4 then let b0 = 0 endif
let b0 = b0 + 1
gosub Buzz
if b0 = 1 then goto Allon
if b0 = 2 then goto Beat
if b0 = 3 then goto Nobubbles
if b0 = 4 then goto Alloff
goto main
Buzz:
for b1 = 1 to b0 ; define loop for b0 times
high buzzer ; switch on output 5
pause 250 ; wait 0.25 seconds
low buzzer ; switch off output 5
pause 250 ; wait 0.25 seconds
next b1 ; end of loop
return
Allon:
Outpins = %00011111
if pin3 = 1 then goto Add
goto Allon
Beat: if pin3 = 1 then goto Add
high LEDTop
high LEDBottom
pause 500
if pin3 = 1 then goto Add
high UVLEDTop
high UVLEDBottom
pause 500
if pin3 = 1 then goto Add
low UVLEDTop
low LEDTop
low UVLEDBottom
low LEDBottom
pause 100
if pin3 = 1 then goto Add
goto beat
Nobubbles:
high UVLEDTop
high LEDTop
high UVLEDBottom
high LEDBottom
low motor
if pin3 = 1 then goto Add
goto Nobubbles
Alloff:
Outpins = %00000000
goto main
Any more input would be great.
Thanks so much.
Doug H.