#include "Arduino.h" #include #include Touch_GT911::Touch_GT911(uint8_t _sda, uint8_t _scl, uint8_t _int, uint8_t _rst, uint16_t _width, uint16_t _height) : pinSda(_sda), pinScl(_scl), pinRst(_rst), width(_width), height(_height) { } TPoint::TPoint(void) { id = x = y = size = 0; } TPoint::TPoint(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _size) { id = _id; x = _x; y = _y; size = _size; } bool TPoint::operator==(TPoint point) { return ((point.x == x) && (point.y == y) && (point.size == size)); } bool TPoint::operator!=(TPoint point) { return ((point.x != x) || (point.y != y) || (point.size != size)); } void Touch_GT911::begin(uint8_t _addr) { addr = _addr; Wire.begin(pinSda, pinScl); } void Touch_GT911::calculateChecksum() { uint8_t checksum; for (uint8_t i=0; i> 7 & 1; uint8_t proximityValid = pointInfo >> 5 & 1; uint8_t haveKey = pointInfo >> 4 & 1; isLargeDetect = pointInfo >> 6 & 1; touches = pointInfo & 0xF; isTouched = touches > 0; if (bufferStatus == 1 && isTouched) { for (uint8_t i=0; i