Neato XV-11: Difference between revisions
| Line 398: | Line 398: | ||
* speed is a two-byte information, little-endian. It represents the speed, in 64th of RPM (aka value in RPM represented in fixed point, with 6 bits used for the decimal part). | * speed is a two-byte information, little-endian. It represents the speed, in 64th of RPM (aka value in RPM represented in fixed point, with 6 bits used for the decimal part). | ||
* Data 0 to Data 3 are the 4 readings. Each one is 4 bytes long, and organized as follows : | * Data 0 to Data 3 are the 4 readings. Each one is 4 bytes long, and organized as follows : | ||
<br /> | |||
byte 0 : Distance 7:0 | byte 0 : Distance 7:0 | ||
byte 1 : “invalid data” flag : “strength warning” flag | |||
byte 1 : “invalid data” flag : “strength warning” flag | byte 2 : Signal Strength 7:0 | ||
byte 3 : Signal Strength 15:8 | |||
byte 2 : Signal Strength 7:0 | |||
byte 3 : Signal Strength 15:8 | |||
As chenglung points out, the distance information is in mm, and coded on 14 bits. This puts the tests made by Sparkfun in a room of around 3.3m x 3.9m (11ft x 13 ft ?), which seems reasonable. | As chenglung points out, the distance information is in mm, and coded on 14 bits. This puts the tests made by Sparkfun in a room of around 3.3m x 3.9m (11ft x 13 ft ?), which seems reasonable. | ||
| Line 422: | Line 419: | ||
The algorithm is as follows, provided that `data` is the list of the 20 first bytes, in the same order they arrived in. | The algorithm is as follows, provided that `data` is the list of the 20 first bytes, in the same order they arrived in. | ||
<br /> | <br /> | ||
def checksum(data): | def checksum(data): | ||