Created
September 29, 2021 10:05
-
-
Save hollyhockberry/a002d226dfe55f502b40b4b1f33da307 to your computer and use it in GitHub Desktop.
M5Paper: Show touch position.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5EPD.h> | |
void setup() { | |
M5.begin(); | |
} | |
void loop() { | |
if (!M5.TP.avaliable()) { | |
return; | |
} | |
M5.TP.update(); | |
if (!M5.TP.isFingerUp()) { | |
for (int n = 0; n < M5.TP.getFingerNum(); ++n) { | |
const tp_finger_t finger = M5.TP.readFinger(n); | |
Serial.printf("[%d] (%3d,%3d) ", n, finger.x, finger.y); | |
} | |
Serial.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment