It won't work

TEZARM

Senior Member
This Code does not work, WHY?
It says mistake in this line: symbol on=0
And the same problem with: symbol off=1

start:

symbol on=0
symbol off=1

if input2=on then ONE
if input2=off then TWO
if input6=on then THREE

ONE:
high 5
pause 800
low 5
goto start

TWO:
high 5
pause 2000
low 5
goto start

THREE:
high 4
pause 2000
low 4
goto start

Yes, this is the same project as a few weeks back. Have finally got back to it again. Please help me with this simple unworkable code.
 

TEZARM

Senior Member
Hi Jeremy.
Thanks but, how can I get the Picaxe to understand that When the input is low to go high on the output and when input is high to go low on the ouput????
 

TEZARM

Senior Member
Toggle. How? Can you show me an example for what I just wrote above Please. Thanks for your help so far.
 

Jeremy Leach

Senior Member
Hi Toggle will give "When the input is low to go high on the output and when input is high to go low on the ouput"

But this isn't what your code is doing. I think the code's fine except ditch the symbols for On and Off and replace On and Off in the code with 1 and 0.

You can use a symbol for 1 and 0 but to me there's little point as it doesn't add any real clarity in this case.

Another comment is that it will never actually run THREE because Input2 can only be 1 or 0 and so code execution will never get as far as THREE.

Edited by - Jeremy Leach on 12/7/2005 10:14:38 AM
 

hippy

Technical Support
Staff member
I think the real problem is that it's not clear what the code is meant to do, so while it doesn't work ( the 'on' and 'off' problem is as Jeremy described - reserved words ), it's hard to give any indication of what the code ought to be.
 

Fowkc

Senior Member
Yeah, get rid of the symbols. Either change their names or ditch them entirely and use 1 and 0.

What exactly is it the program is for? Put it in context for us.

Edit: Sorry, you have done in another thread. Apologies

Edited by - Fowkc on 12/7/2005 11:30:06 PM
 
Isn't the mistake in the missing spaces between the symbol name and the = sign, and after the = sign or am I talking rubbish?
 
Top