Working on my first VSM circuit.
Looking for a little help as how to get this properly laid out, and the circuit isnt working as expected.
The simulation file should give you a good idea how this is supposed to work.View attachment Motorcycle Flasher Program.bas
Upon 3 pushes of the horn, the flasher should engage.
A 12V supply, with the 5v regulator to supply the input for picaxe.
I will try my best to answer any questions.
Thank you for the assistance.
Looking for a little help as how to get this properly laid out, and the circuit isnt working as expected.
The simulation file should give you a good idea how this is supposed to work.View attachment Motorcycle Flasher Program.bas
Upon 3 pushes of the horn, the flasher should engage.
A 12V supply, with the 5v regulator to supply the input for picaxe.
I will try my best to answer any questions.
Thank you for the assistance.
Code:
setint %00000010,%00000010 ;arm interrupt for high on pin C.1
init:
let b0 = 0 ;switch counter byte
gosub allLow ;make sure the turn signals are all off
main:
if b0 = 3 then flasher
goto main
flasher:
high b.5 ; LF Turn Signal High
high b.4 ; RF Turn Signal High
high b.3 ; LR Turn Signal High
high b.2 ; RR Turn Signal High
if b0 = 4 then init ;check counter byte for 6th button press, if so, exit to init without having to wait for the 1 second pause below
pause 1000 ; for simulation only
gosub allLow ; put all turn signals low ^
if b0 = 4 then init ;this here again so, on 6th button press, user will see immediate exit to init without having to wait for the 1 second pause below
pause 1000
goto flasher
allLow:
low b.5 ; LF Turn Signal Low
low b.4 ; RF Turn Signal Low
low b.3 ; LR Turn Signal Low
low b.2 ; RR Turn Signal Low
return
interrupt:
if pinC.1 = 1 then
goto interrupt ;debounce switch
elseif pinC.1 = 0 then endif
do if pinc.1=0 then inc b0
elseif b0 =5 then goto flasher
if b0=>1 then
goto init:
loop
endif
endif
setint %00000010,%00000010 ;re-arm interrupt for high on pin C.1
return