Finger paint example

This commit is contained in:
KTOWN 2013-10-08 19:06:39 +02:00
parent 7328b81d75
commit 43473ad407
1 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,9 @@ void setup()
void loop() void loop()
{ {
float xScale = 1024.0F/tft.width();
float yScale = 1024.0F/tft.height();
/* Wait around for touch events */ /* Wait around for touch events */
if (! digitalRead(RA8875_INT)) if (! digitalRead(RA8875_INT))
{ {
@ -90,7 +93,8 @@ void loop()
Serial.print("Touch: "); Serial.print("Touch: ");
tft.touchRead(&tx, &ty); tft.touchRead(&tx, &ty);
Serial.print(tx); Serial.print(", "); Serial.println(ty); Serial.print(tx); Serial.print(", "); Serial.println(ty);
/* Draw a circle */
tft.fillCircle((uint16_t)(tx/xScale), (uint16_t)(ty/yScale), 10, RA8875_WHITE);
} }
} }
} }