Manual
www.nexusrobot.com Robot Kits manual
28
Read Distance
Command:
Header Address Length Cmd High Byte Low Byte SUM
55 aa ADD 2 02 H L SUM
PS: The command will return the measured distance value. The value consists of two bytes. If the
measurement is out of range or unsuccessful, the return data will be “0xFF(H) 0xFF(L)”.
Example:
Command:
0x55 0xaa 0x11 0x00 0x02 0x12(SUM)
Return:
0x55 0xaa 0x11 0x02 0x02 0x01 0x0A 0x11 (Distance is 266 cm)
0x55 0xaa 0x11 0x02 0x02 0xFF 0xFF 0x1F (Out of Range)
Read temperature
Command:
Header Address Length Cmd SUM
55 aa ADD 0 03 SUM
Header Address Length Cmd High Byte Low Byte SUM
55 aa ADD 2 03 H L SUM
PS: The command will return the temperature reading. The return temperature reading is using Celsius
scale. If the temperature is above 0 Celsius, the first four bits of High will be all 0. If the temperature is
below 0 Celsius, the first four bits of High will be all 1. The last 4 bits of High together with the Low bits
stands for 12bits temperature. The resolution is 0.1. When the reading is invalid, it returns 0xFF 0xFF
Example:
Command:
0x55 0xaa 0x11 0x00 0x03 0x13(SUM)
Return:
0x55 0xaa 0x11 0x02 0x03 0xF0 0x0A 0x11 (+1 Celsius Degree)
0x55 0xaa 0x11 0x02 0x03 0x00 0x0A 0x20 (-1 Celsius Degree)
0x55 0xaa 0x11 0x02 0x03 0xFF 0xFF 0x20 (Out of Range)
Header Address Length Cmd SUM
55 aa ADD 0 02 SUM