Hi all,
I am starting out in electronics and i have written a programme for the school axe092 experimenter board picaxe-08m. The programme runs fine on a simulation but i haven't ordered the board yet. is the following programme too long? am i going to need a larger memory chip? is there anyway i can find out?
Your help is much appreciated.
main: let b1 = 0
start:
if pin3 = 1 then goto steph
goto start
steph:
high 2
pause 5000
low 2
high 1
pause 5000
low 1
inc b1
if pin3 = 0 and b1 >600 then goto contraction_break_morethan10
if pin3 = 0 and b1 >36 then goto contraction_break_lessthan10
if pin3 = 0 and b1 <36 then goto contraction_break_lessthan6
goto start
contraction_break_morethan10:
do
high 2 ‘ green LED on
pause 5000
low 2 ‘ green LED off
loop until pin3 =1
goto main
contraction_break_lessthan10:
do
high 1 ‘yellow LED on
pause 5000
low 1 'yellow LED off
loop until pin3 =1
goto main
contraction_break_lessthan6:
do
high 0 'red LED on
pause 5000
low 0 'red LED off
loop until pin3 =1
goto main
I am starting out in electronics and i have written a programme for the school axe092 experimenter board picaxe-08m. The programme runs fine on a simulation but i haven't ordered the board yet. is the following programme too long? am i going to need a larger memory chip? is there anyway i can find out?
Your help is much appreciated.
main: let b1 = 0
start:
if pin3 = 1 then goto steph
goto start
steph:
high 2
pause 5000
low 2
high 1
pause 5000
low 1
inc b1
if pin3 = 0 and b1 >600 then goto contraction_break_morethan10
if pin3 = 0 and b1 >36 then goto contraction_break_lessthan10
if pin3 = 0 and b1 <36 then goto contraction_break_lessthan6
goto start
contraction_break_morethan10:
do
high 2 ‘ green LED on
pause 5000
low 2 ‘ green LED off
loop until pin3 =1
goto main
contraction_break_lessthan10:
do
high 1 ‘yellow LED on
pause 5000
low 1 'yellow LED off
loop until pin3 =1
goto main
contraction_break_lessthan6:
do
high 0 'red LED on
pause 5000
low 0 'red LED off
loop until pin3 =1
goto main