Please help
I have been working on the serrxd code for three days with little luck.
The program has worked for years in the real world using button presses as control inputs.
what I am trying to do now is replace the button press inputs.
By doing this I replace 3 button press inputs with one serrxd command and can
monitor for all buttons.
if I use serrxd ($10) the program executes
if I use serrxd ($10),b1 the program executes if I don't check the value of b1
but if I use serrxd($10,$03) it doesn't
the sertxd works fine and I can send any data I want to the Navigation board and it responds as expected.
I know that the serrxd will wait until it receives the qualifier which is what I want.
I know that the baudrate should be 19200. Anything else and Command_1 don't work.
To test the baudrate I commented out the serrxd and Command_1 works
I know the sequence I am looking for is on the data line. It is the first 7 characters of the
commands. Also $10,$03 is constantly on the data line.
What I am trying to do is read the data line for the following sequence.
serrxd($10,$03,$10,$8A,$0C,$01,$00),b1
The value of b1 determines which button has been pressed and so
which command will be executed.
#picaxe 08m2
setfreq M16
Disconnect
Main: ' Main loop
' Wait for data on Serial_line at startup
Serrxd($10,$03) ' Wait for Data line to initialize
wait 60
gosub Command_1
Stop
Command_1:
pause 250
sertxd ($10,$03,$10,$8A,$0C,$01,$00,$41,$CC,$10,$10,$36,$12,$00,$F1,$F5,$F5,$80,$A9)
sertxd ($10,$03,$10,$8A,$0C,$02,$00,$41,$CC,$30,$75,$12,$00,$F1,$F5,$F5,$80,$49)
pause 500
return
I have been working on the serrxd code for three days with little luck.
The program has worked for years in the real world using button presses as control inputs.
what I am trying to do now is replace the button press inputs.
By doing this I replace 3 button press inputs with one serrxd command and can
monitor for all buttons.
if I use serrxd ($10) the program executes
if I use serrxd ($10),b1 the program executes if I don't check the value of b1
but if I use serrxd($10,$03) it doesn't
the sertxd works fine and I can send any data I want to the Navigation board and it responds as expected.
I know that the serrxd will wait until it receives the qualifier which is what I want.
I know that the baudrate should be 19200. Anything else and Command_1 don't work.
To test the baudrate I commented out the serrxd and Command_1 works
I know the sequence I am looking for is on the data line. It is the first 7 characters of the
commands. Also $10,$03 is constantly on the data line.
What I am trying to do is read the data line for the following sequence.
serrxd($10,$03,$10,$8A,$0C,$01,$00),b1
The value of b1 determines which button has been pressed and so
which command will be executed.
#picaxe 08m2
setfreq M16
Disconnect
Main: ' Main loop
' Wait for data on Serial_line at startup
Serrxd($10,$03) ' Wait for Data line to initialize
wait 60
gosub Command_1
Stop
Command_1:
pause 250
sertxd ($10,$03,$10,$8A,$0C,$01,$00,$41,$CC,$10,$10,$36,$12,$00,$F1,$F5,$F5,$80,$A9)
sertxd ($10,$03,$10,$8A,$0C,$02,$00,$41,$CC,$30,$75,$12,$00,$F1,$F5,$F5,$80,$49)
pause 500
return