🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5stickC Touch Sensing

    UIFlow
    3
    4
    6.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xis
      last edited by

      Hello,
      I need to read the values from a touch sensing pin.
      GPIO33 is touch8 so with arduino code one can use touchread(8)
      How can I do this using UIFlow?
      Thank you.

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hi @xls

        try something like this in an Advanced - Execute - Execute code: block:

        from machine import Pin, TouchPad
        t8 = 0
        touch8 = TouchPad(Pin(33))
        t8 = touch8.read()
        

        Cheers
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • world101W
          world101
          last edited by

          Using @felmue's example, here is how I did it. For some reason I could only use the pins on the Grove port (32 or 33) of the M5StickC for capacitive touch. The GPIO pins at the top header (0, 23, 36) didn't work for me. I understand why 23 and 36 don't work (they are not one of the capacitive touch pins on the ESP32), but pin 0 should have worked according to the MicroPython docs.

          http://docs.micropython.org/en/v1.11/esp32/quickref.html#capacitive-touch

          0_1605132644839_Screen Shot 2020-11-11 at 5.06.57 PM.png

          0_1605132863786_IMG_1729.PNG
          0_1605132878725_IMG_1728.PNG

          1 Reply Last reply Reply Quote 1
          • X
            xis
            last edited by

            Thank you!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post