How check if four variables and then code for 40X2, example b0 = 1, b1 = 1, b2 = 0, b3 = 0 when check same time four variables together then code, I tried to find info like 86 pages, manual2. Just show simple code example here, but other long code I make own, not like here so only show example.
dirsA=%11111111
main:
if pinC.1 = 1 then first
if pinC.0 = 1 then second
goto main
first:
b0 = 1
b1 = 1
b2 = 0
b3 = 0
wait 2
goto check
second:
b0 = 0
b1 = 0
b2 = 1
b3 = 1
wait 2
goto check
check:
if b0 = 1, b1 = 1, b2 = 0, b3 = 0 then light1 'something is wrong, how command?
if b0 = 0, b1 = 0, b2 = 1, b3 = 1 then light2 'check 4 variables like 0 or 1 each other then
end
light1:
pinsA=%11110000
wait 2
pinsA=%00000000
b0 = 0
b1 = 0
goto main
light2:
pinsA=%00001111
wait 2
pinsA=%00000000
b2 = 0
b3 = 0
goto main
dirsA=%11111111
main:
if pinC.1 = 1 then first
if pinC.0 = 1 then second
goto main
first:
b0 = 1
b1 = 1
b2 = 0
b3 = 0
wait 2
goto check
second:
b0 = 0
b1 = 0
b2 = 1
b3 = 1
wait 2
goto check
check:
if b0 = 1, b1 = 1, b2 = 0, b3 = 0 then light1 'something is wrong, how command?
if b0 = 0, b1 = 0, b2 = 1, b3 = 1 then light2 'check 4 variables like 0 or 1 each other then
end
light1:
pinsA=%11110000
wait 2
pinsA=%00000000
b0 = 0
b1 = 0
goto main
light2:
pinsA=%00001111
wait 2
pinsA=%00000000
b2 = 0
b3 = 0
goto main
Last edited: