Hi all,
I am trying to simulate a program, but it always pop ups for a syntax error in the following line :
How to write case ("restart") ?
this is the full program if it helps answering:
I am trying to simulate a program, but it always pop ups for a syntax error in the following line :
Code:
case ("restart")
sertxd("Reseting the program!")
b1 = 0
goto main
this is the full program if it helps answering:
Code:
main: 'main program entry
low 0,1,2,3,4,5,6,7 'set all outputs to low
serrxd ("go") 'wait to receive string "go" from serial port
reconnect 'reconnects after receiving "go"from serial port
goto _read 'Goes to _read sub
_read:
serrxd b0 'waits to receive a string from serial port
select b0
case "0"
sertxd("LED 0 Toggled!")
toggle 0
case "1"
sertxd("LED 1 Toggled!")
toggle 1
case "2"
sertxd("LED 2 Toggled!")
toggle 2
case "3"
sertxd("LED 3 Toggled!")
toggle 3
case "4"
sertxd("LED 4 Toggled!")
toggle 4
goto main
case "5"
sertxd("LED 5 Toggled!")
toggle 5
case "6"
sertxd("Dancing!")
goto dance
case ("restart")
sertxd("Reseting the program!")
b1 = 0
goto main
else
goto _read
endselect
goto _read
dance:
high 0,2,4
pause 50
low 0,2,4
pause 50
high 1,3,5
pause 50
low 1,3,5
high 0,2,4
pause 100
low 0,2,4
pause 100
high 1,3,5
pause 100
low 1,3,5
high 0,2,4
pause 200
low 0,2,4
pause 200
high 1,3,5
pause 200
low 1,3,5
goto _read