Jasper.carpenter
- Sep 23, 2019
- 3
- Joined
- Sep 23, 2019
- Messages
- 3
I am trying to make a variable increase every time a sensor senses something. I also want a button to reset the variable counter. I have been trying for a while but I still don't quite get it. This is the code I have so far.
[mod edit: moved to to code box]
I keep on getting syntax error at line 11 before position 15 (IF b1= 1 then b2=b2+1) saying 'Error: Expected a label not the variable B2'
I have created a loading circuit and plugged the into the sensor, and I have a display but am not sure how to program that either. It would be much appreciated if someone could help me out.
[mod edit: moved to to code box]
Code:
#no_data
start:
readadc c.0,b1
readadc b.5,b3
debug b0
main:
b2=0
sensor:
IF b1= 1 then b2=b2+1
endif
IF b3= 1 then goto start:
goto sensor:
I keep on getting syntax error at line 11 before position 15 (IF b1= 1 then b2=b2+1) saying 'Error: Expected a label not the variable B2'
I have created a loading circuit and plugged the into the sensor, and I have a display but am not sure how to program that either. It would be much appreciated if someone could help me out.
Last edited by a moderator: