Hi,
maybe someone can use it:
maybe someone can use it:
B4X:
Sub Globals
'dll: bitwise.dll, object: bit
nmea = "$GPGGA,161649.417,4841.7903,N,01004.0221,E,2,05,2.0,578.3,M,48.0,M,1.0,0000*7D" 'example
Dim checksum
n = 1
End Sub
Sub App_Start
Form1.Show
bit.New1
sign = StrAt(nmea,1)
Do Until sign = "*"
sign = Int(Asc(sign))
checksum = bit.XOR(checksum,sign)
n = n + 1
sign = StrAt(nmea,n)
Loop
Msgbox("ASCII: " & checksum & crlf & "HEX: " & StrToUpper(bit.DecToHex(checksum)))
End Sub