Hello guys,
i just got the proton IDE which helps me do BASIC coding, and thinking of creating a simple programme
that takes predetermined bits from a data stream, and outputs the predetermined bits
so the code goes something like:
DEFINE OSC 20
Device = 16F877
Dim Position[24] As Byte
TRISA = %00000010
Declare RSIN_PIN PORTA.0
Declare SERIAL_BAUD 4800
Loop:
RSIn Wait ("GPGGA"), [Position]
SerOut PORTA.1, 16780, [Position]
GoTo Loop
So what I want to do from the code is
1) Take the next 24 bytes after i detect the string "GPGGA"
2) Store it to the variable Position
3) and then transmit it at a lower bit rate, i.e. 2400baud (which is 16780)
I was looking through the help files, I see how they take ONE byte after GPGGA
I also can see how they take in strings
but when i combine the two together (Taking in string after a string) my programme cant compile due to some syntax error in the lines:
RSIn Wait ("GPGGA"), [Position]
SerOut PORTA.1, 16780, [Position]
Any ideas whats going on and how can i get it running?
(i have changed the lines a few times) This programme below works ( Position is changed from a string to just one byte), but the top one doesn't...
DEFINE OSC 20
Device = 16F877
Dim Position As Byte
TRISA = %00000010
Declare RSIN_PIN PORTA.0
Declare SERIAL_BAUD 4800
Loop:
RSIn Wait ("GPGGA"), Position
SerOut PORTA.1, 16780, [Position]
GoTo Loop
Thanks!
i just got the proton IDE which helps me do BASIC coding, and thinking of creating a simple programme
that takes predetermined bits from a data stream, and outputs the predetermined bits
so the code goes something like:
DEFINE OSC 20
Device = 16F877
Dim Position[24] As Byte
TRISA = %00000010
Declare RSIN_PIN PORTA.0
Declare SERIAL_BAUD 4800
Loop:
RSIn Wait ("GPGGA"), [Position]
SerOut PORTA.1, 16780, [Position]
GoTo Loop
So what I want to do from the code is
1) Take the next 24 bytes after i detect the string "GPGGA"
2) Store it to the variable Position
3) and then transmit it at a lower bit rate, i.e. 2400baud (which is 16780)
I was looking through the help files, I see how they take ONE byte after GPGGA
I also can see how they take in strings
but when i combine the two together (Taking in string after a string) my programme cant compile due to some syntax error in the lines:
RSIn Wait ("GPGGA"), [Position]
SerOut PORTA.1, 16780, [Position]
Any ideas whats going on and how can i get it running?
(i have changed the lines a few times) This programme below works ( Position is changed from a string to just one byte), but the top one doesn't...
DEFINE OSC 20
Device = 16F877
Dim Position As Byte
TRISA = %00000010
Declare RSIN_PIN PORTA.0
Declare SERIAL_BAUD 4800
Loop:
RSIn Wait ("GPGGA"), Position
SerOut PORTA.1, 16780, [Position]
GoTo Loop
Thanks!