Hi E,hi C,
You know an Array Byte is 8 Bits long, and you can get two BCD chars in a Byte, value from 0 0 thru F F.
So, why are you adding a '$' in the array(0).?
Also, what if while reading the GPS message, the 'W' is not received.?
Remember, we tested for the 'comma's in the message to check that a message was valid or incomplete.
We covered and fully debugged receiving and formatting this GPS message coding about 7+ years ago.
E
Bearing in mind that I'm new to ARRAYS, I'm pretty sure that the Incremental encoder is outputting 2x BYTEs 0-255 and 0-255, which when combined give 0-359 Degrees. I have been testing the rest of the (10) ARRAY in the same way, giving each one any number between - and 255, which is working.
My previous post mentioned errors when the send array and the receive array are of different size, so I thought of a similar idea to a start and stop BIT, but in this case BYTEs, to count the BYTES between start and end, so that they both can match. I presume the GPS NMEA sentences use a $ at the beginning and a * at the end for the same reason??, so I thought I could do the same, although I know they have a checksum.
7+years
anyway, since then some things have changed, (from memory) I think the NMEA sentences are tested at the beginning $ and at the end W, so if one is missing it skips till another message?? I can check, if you want. Also I can now set them to only send 1x chosen message.
C.