Hey,
This board used the FT6206 chip, which communicates with the arduino over i2c. I've been using the Adadruit_FT6206 library with the touch screen, and have detection of points working fine.
I found this datasheet: https://cdn-shop.adafruit.com/datasheets/FT6x06_AN_public_ver0.1.3.pdf, which says that it should be possible to use gestures such as touch up/down and zoom with the shield. According to the datasheet, there is a gest_id available on one of the i2c registers, which can simply be requested for over the i2c bus.
I have altered the readData() function of the library as follows (last 3 lines of code):
void Adafruit_FT6206::readData(uint16_t *x, uint16_t *y) {
uint8_t i2cdat[16];
Wire.beginTransmission(FT6206_ADDR);
Wire.write((byte)0);
Wire.endTransmission();
Wire.beginTransmission(FT6206_ADDR);
Wire.requestFrom((byte)FT6206_ADDR, (byte)32);
for (uint8_t i=0; i<16; i++)
i2cdat[i] = Wire.read();
Wire.endTransmission();
touches = i2cdat[0x02];
//Serial.println(touches);
if (touches > 2) {
touches = 0;
*x = *y = 0;
}
if (touches == 0) {
*x = *y = 0;
return;
}
/*
if (touches == 2) Serial.print('2');
for (uint8_t i=0; i<16; i++) {
// Serial.print("0x"); Serial.print(i2cdat[i], HEX); Serial.print(" ");
}
*/
/*
Serial.println();
if (i2cdat[0x01] != 0x00) {
Serial.print("Gesture #");
Serial.println(i2cdat[0x01]);
}
*/
//Serial.print("# Touches: "); Serial.print(touches);
for (uint8_t i=0; i<2; i++) {
touchX[i] = i2cdat[0x03 + i*6] & 0x0F;
touchX[i] <<= 8;
touchX[i] |= i2cdat[0x04 + i*6];
touchY[i] = i2cdat[0x05 + i*6] & 0x0F;
touchY[i] <<= 8;
touchY[i] |= i2cdat[0x06 + i*6];
touchID[i] = i2cdat[0x05 + i*6] >> 4;
}
*x = touchX[0]; *y = touchY[0];
// TESTING GESTURES
int gestureId = i2cdat[0x01];
Serial.print("x,y,w: "); Serial.print(i2cdat[0x04]); Serial.print(", "); Serial.print(i2cdat[0x06]); Serial.print(", "); Serial.println(i2cdat[0x07]);
Serial.print("gest_id: "); Serial.println(gestureId);
}
However gives output similar to:
x,y,w: 67, 207, 0
gest_id: 0
with the gest_id always being 0.
Many Thanks
Henry