![]() Uint16_t is the datatype for a number that is 2 bytes (hence the 16, which is the number of bits) and unsigned, which means it can only be positive, and it also means the first bit will not be treated as a sign flag. Then, combine them into a single unsigned int using: ![]() Read data from register 0x00 and 0x01, storing the 8-bit values into variables: To combine them into one larger value, the following operation is performed: This means that the data for the 12 pins is split between the two registers. The MPR121 stores pin states (0 or 1) in two bytes, with the LSB (Least Significant Bit) corresponding to either touch-pin 0 or touch-pin 8, since bytes have only 8 bits. For the MPR121, binary touch data is stored in registers 0x00 and 0x01.
0 Comments
Leave a Reply. |