🛠 Reading touch coordinates
M5Paper IoT Development Kit with 4.7-inch Touchscreen e-Ink Display · debutant · Utiliser le capteur capacitif GT911 pour détecter les zones touchées sur l'écran.
- Hardware: M5Paper powered via USB.
- Library: Use the same setup as display, ensure M5EPD library is updated.
- Code: In setup(), init the screen. In loop(), call M5.EPD.ReadTouch(). Check if M5.EPD.Touched() is true.
- Processing: If touched, get coordinates via M5.EPD.xPos and M5.EPD.yPos. Print these to Serial for raw data visualization.
- Visualization: Clear a screen area (M5.EPD.Clear()) then draw a circle at the touched coordinates for immediate visual feedback.
- Verify: Touch the screen. Serial values should change with position. The screen image should update.
- Next Step: Implement software 'debounce' to avoid multiple detections on a single press.
Other tutorials for this board
Code examples for this board
← Back to the board 🛠 All tutorials