Checksum help please~
Zap-o
Posts: 452
in Propeller 1
I have made a sensor that uses a propeller for measuring the earths magnetic field. My intention was to send these data to a computer that is running a program to chart the data. My issue is the checksum. I have kind of an idea how it works when receiving data but I am really stuck with sending.
1.) from my best guess the program uses NMEA sentences but what kind of Checksum I am unclear, is there not multiple types of Checksum, my wiki research shows all sorts - but again I could be wrong.
Here is a sample of the string I am sending and I hope is in a NMEA style.
And here is the crude method currently packing it all together into a string, but as you can see I have 00 as the Checksum because I cant calculate a value - I have no idea where to begin.
So I ask my fearful coders to offer some ideas and most importantly something I can validate and check or use to make this function work.
Thanks in advance
1.) from my best guess the program uses NMEA sentences but what kind of Checksum I am unclear, is there not multiple types of Checksum, my wiki research shows all sorts - but again I could be wrong.
Here is a sample of the string I am sending and I hope is in a NMEA style.
$GPHDT,120.00,T*00<CR><LF>
And here is the crude method currently packing it all together into a string, but as you can see I have 00 as the Checksum because I cant calculate a value - I have no idea where to begin.
Serial.str(String("$GPHDT,")) Serial.str(Math.FloatToFormat(MAgnetic_North,7,3)) Serial.Char(",") Serial.Char("T") Serial.Char("*") Serial.Char("0") Serial.Char("0") Serial.char(13) Serial.char(10)
So I ask my fearful coders to offer some ideas and most importantly something I can validate and check or use to make this function work.
Thanks in advance
Comments
Test against this calculator:
http://nmeachecksum.eqth.net/
$GPHDT,120.00,T*06<CR><LF>
Mike R...
I'm attaching a simple generator I made for testing a decoder object, uses canned messages but generates the checksum.
The relevant bit is: