🛠 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.

  1. Hardware: M5Paper powered via USB.
  2. Library: Use the same setup as display, ensure M5EPD library is updated.
  3. Code: In setup(), init the screen. In loop(), call M5.EPD.ReadTouch(). Check if M5.EPD.Touched() is true.
  4. Processing: If touched, get coordinates via M5.EPD.xPos and M5.EPD.yPos. Print these to Serial for raw data visualization.
  5. Visualization: Clear a screen area (M5.EPD.Clear()) then draw a circle at the touched coordinates for immediate visual feedback.
  6. Verify: Touch the screen. Serial values should change with position. The screen image should update.
  7. 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