Hi,
I am trying to read a RS232 string and act upon it.
IE. RS232 in is "ABC1" @ 9600 baud, place in variable R
Can I then simply do If R = ABC1 Then excute the command?
Peter
Printable View
Hi,
I am trying to read a RS232 string and act upon it.
IE. RS232 in is "ABC1" @ 9600 baud, place in variable R
Can I then simply do If R = ABC1 Then excute the command?
Peter
No or, not directly. You'll need to compare an String Array to another one.
If you have only 1 string to act with you can also use the WAIT modifier.
In my case, when i need to jump to several Subroutine with PCTask, i use a simple Byte and Branch(or more than often BRANCHL)
something like
easier than use this precious Code space to store String stuff IMHO.Code:SubRoutineToBeExecute var byte
Main:
HSERIN[SubRoutineToBeExecute]
branch SubRoutineToBeExecute,[Sub1,Sub2,Sub3,Sub4]
goto Main
Sub1:
' stuff here
goto Main
Sub2:
' stuff here
goto Main
Sub3:
' stuff here
goto Main
Sub4:
' stuff here
goto Main
Steve,
Shouldn't I be using SerIn on a PIC12F675?
(Sorry I negeleted to mention it before)
Peter
sure you can use SERIN, SERIN2, DEBUG...