Hi,
I have used the PICAXE many times before and I have become familiar with most of the commands in the "Command Summary" adobe file. I am doing a comparison between variables and I am looking for a way of doing a 'is not equal' to equation. I know that in many languages you can type != .
Here is the code I am trying to shorten:
if pin0=1 and b1 = 1 then decay1
if pin0=1 and b1 = 2 or b1 = 3 or b1 = 4 or b1 = 5 or b1 = 6 or b1 = 7 or b1 = 8 or b1 = 9 or b1 = 0 or b1 = 11 or b1 = 12 then lock
As you can see it is very long, and I have about two hundred copies of this code in my program, and hence it will not fit on a 600-line pic.
Ideally I would like to be able to put:
if pin0=1 and b1 = 1 then decay1
if pin0=1 and b1 != 1 then lock
Is there another way? I am in need of help here.
The code says:
When button 0 is pressed if b1=1 then do this, if b1= another of the other 12 numbers do XXX.
I cannot do an "else" statement. The reasons for this are very long and complex. Any ideas?
Yours thankfully,
Joe Valentine
I have used the PICAXE many times before and I have become familiar with most of the commands in the "Command Summary" adobe file. I am doing a comparison between variables and I am looking for a way of doing a 'is not equal' to equation. I know that in many languages you can type != .
Here is the code I am trying to shorten:
if pin0=1 and b1 = 1 then decay1
if pin0=1 and b1 = 2 or b1 = 3 or b1 = 4 or b1 = 5 or b1 = 6 or b1 = 7 or b1 = 8 or b1 = 9 or b1 = 0 or b1 = 11 or b1 = 12 then lock
As you can see it is very long, and I have about two hundred copies of this code in my program, and hence it will not fit on a 600-line pic.
Ideally I would like to be able to put:
if pin0=1 and b1 = 1 then decay1
if pin0=1 and b1 != 1 then lock
Is there another way? I am in need of help here.
The code says:
When button 0 is pressed if b1=1 then do this, if b1= another of the other 12 numbers do XXX.
I cannot do an "else" statement. The reasons for this are very long and complex. Any ideas?
Yours thankfully,
Joe Valentine