Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit f4845e6

Browse files
authored
Ensure checksum is 2 digits (#143)
Fix bug where some L76 messages are ignored due to the checksum being one digit long (i.e. 'F') vs. the expected 2 digit length ('0F')
1 parent 29c580d commit f4845e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shields/lib/L76GNSS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _checksum(self, nmeadata):
113113
calc_cksum = 0
114114
for s in nmeadata:
115115
calc_cksum ^= ord(s)
116-
return('{:X}'.format(calc_cksum))
116+
return('{:02X}'.format(calc_cksum))
117117

118118
def write(self, data):
119119
self.i2c.writeto(GPS_I2CADDR, '${}*{}\r\n'.format(data, self._checksum(data)) )

0 commit comments

Comments
 (0)