Shop OBEX P1 Docs P2 Docs Learn Events
Checksum help please~ — Parallax Forums

Checksum help please~

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.
  $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

Sign In or Register to comment.