binary1248
Senior Member
I am converting some simple ode from 08m2 written years ago to 18m2 chip.
My 1st if statement fails on 18m2 but works on 08m2.
What gives, I will try to attach code.
Some other problems exists but I need to get by this if statement error.
#picaxe 18M2 ;define chip type
;
symbol redled=b.7 ;pin 13 on chip Output pins for led lights
symbol yelled=b.6 ;pin 12 on chip
symbol grnled=b.5 ;pin 11 on chip
symbol inblck=b.0 ;input pin 6 on chip 1st block sense
symbol outblck=b.1 ;input pin 7 on chip 2nd block sense
Start:
input b.0,b.1 ;make ports b.0 & b.1 inputs
output b.5,b.6,b.7
;little startup test seq lamps
gosub testblnk
Main:
; Find 1st block entry switch triped
;note for testing reversed polarty allowing bb test buttons
red: if pin inblck= 1 then ;physical pin 6
high redled ;turn on red
low yelled ;turnoff yellow
low grnled ;turn off grn
endif
if outblck =1 then
goto yellow ;process yellow with exit timer
else goto red
endif
My 1st if statement fails on 18m2 but works on 08m2.
What gives, I will try to attach code.
Some other problems exists but I need to get by this if statement error.
#picaxe 18M2 ;define chip type
;
symbol redled=b.7 ;pin 13 on chip Output pins for led lights
symbol yelled=b.6 ;pin 12 on chip
symbol grnled=b.5 ;pin 11 on chip
symbol inblck=b.0 ;input pin 6 on chip 1st block sense
symbol outblck=b.1 ;input pin 7 on chip 2nd block sense
Start:
input b.0,b.1 ;make ports b.0 & b.1 inputs
output b.5,b.6,b.7
;little startup test seq lamps
gosub testblnk
Main:
; Find 1st block entry switch triped
;note for testing reversed polarty allowing bb test buttons
red: if pin inblck= 1 then ;physical pin 6
high redled ;turn on red
low yelled ;turnoff yellow
low grnled ;turn off grn
endif
if outblck =1 then
goto yellow ;process yellow with exit timer
else goto red
endif
Last edited: