CK = Checksum (00-FF)
TX: | 2 | 3 | 4 | CK | FUNCTION: ADC 8-BIT | RX: | 2 | 2 | 3 | CK |
AA | 02 | FE | 9E | 48 | Read ADC Input 1 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | 9F | 49 | Read ADC Input 2 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A0 | 4A | Read ADC Input 3 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A1 | 4B | Read ADC Input 4 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A2 | 4C | Read ADC Input 5 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A3 | 4D | Read ADC Input 6 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A4 | 4E | Read ADC Input 7 | AA | 02 | 03 | FF | AE |
AA | 02 | FE | A5 | 4F | Read ADC Input 8 | AA | 02 | 03 | FF | AE |
The following command will return 16 bytes of data. Data is arranged in numeric order (C1-C8) from channel 1 to channel 8. Each channel is represented as a 10-Bit value (MSB and LSB). The Checksum is represented in the CK column.
CK = Checksum (00-FF)
TX: | 2 | 3 | 4 | CK | Function: | RX: | 2 | MSB | LSB | NOTE |
AA | 02 | FE | A7 | 50 | Read All 8-Channels | AA | 10 | 03 | FF | Bytes 3/4 AD1 |
| | | | | | | | 03 | FF | Bytes 5/6 AD2 |
| | | | | | | | 03 | FF | Bytes 7/8 AD3 |
| | | | | | | | 03 | FF | Bytes 9/10 AD4 |
| | | | | | | | 03 | FF | Bytes 11/12 AD5 |
| | | | | | | | 03 | FF | Bytes 13/14 AD6 |
| | | | | | | | 03 | FF | Bytes 15/16 AD7 |
| | | | | | | | 03 | FF | Bytes 17/18 AD8 |
| | | | | | | | | CA | Byte 19 Checksum |
Converting MSB and LSB into an Integer:
The tables above demonstrate how 10-Bit data is communicated using 8-Bit values. To convert the 8-Bit values into a usable integer, follow this simple formula:
Analog Value = (MSB x 256) + LSB
Analog Value = (3 x 256) + 255
Analog Value = 1023