Dear all
I try this code on simulate , the code ruining but not reach to main1
I try this code on simulate , the code ruining but not reach to main1
So please help me to know why and how fix it
many thank you
I use 2 moment switch at pin 3 and 4 ( picaxe08) and pin1 ,pin2 to H-bridge motor
#Picaxe 08M
do
Symbol PIN_IN = pin3
Symbol counter = b0
main:
if pin3 = 1 then mar
if pin4=1 then low 1 endif
goto main
mar:
if pin3 = 1 then mar
inc b0
if b0= 2 then high 1 low 2 endif; for change direction of motor
if pin4= 1 then low 1
b0=0
endif
goto main
For counter = 1 To 10; It's really over 1000 but i put 10 for quick check on ;simulate
Gosub WaitForPulse
Next
;//////////
;;;;;;;;;;;;;;;;;;; not reach to the code below
main1:
if pin3 = 1 then mar1
if pin4=1 then low 2
endif
goto main
mar1:
if pin3 = 1 then mar1
inc b0
if b0= 2 then high 2 low 1 ; for change direction of motor
endif
if pin4=1 then low 2
endif
b0=0;
goto main1
For counter = 10 to 1 step-1; It's really over 1000 but i put 10 for quick check ; on simulate
Gosub WaitForPulse
Next
let b0=0
loop
'/////////
WaitForPulse:
Do : Loop While PIN_IN = 1
Do : Loop Until PIN_IN = 1
Return