Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Touchpad support implemented

    Scheduled Pinned Locked Moved Enhancements
    esp32touchmodulesenhancement
    5 Posts 2 Posters 702 Views 3 Watching
    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.
    • P Offline
      psychogenic
      last edited by

      Re: Touch pin functionality
      When I finally came around to using all those wonderful touch pads on the GPy pinout, it was quite disheartening to find posts, 1 and 2 years old, asking about when it'd be implemented and nothing since. Groan.

      So I've created a branch of the latest firmware that actually has touchpad support. Hopefully it'll be merged into the main trunk but in the meantime you can get it at
      https://github.com/psychogenic/pycom-micropython-sigfox/tree/touchsupport

      I made it part of the machine module, as machine.TouchPad. Sample usage:

      # define a callback, triggered by touches
      def hullo(thepad):
          print("Hullooo: %s" % str(thepad))
      
      # trigger arg is optional, but makes the pads 
      # much more useful... create some touch pads
      t6 = machine.TouchPad('P23', trigger=hullo)
      t8 = machine.TouchPad('P20', trigger=hullo)
      
      # to figure out thresholds, do a read:
      t6.read()
      # >> 1149
      t8.read()
      # >> 1034
      
      t6.threshold(600)
      t8.threshold(500)
      
      # and that's it, on touch you'll see something like
      # Hullooo: TouchPad(T8)
      
      # you can also access the pad id (the "touch index")
      t6.id()
      # >> 6
      
      # clean-up when done
      t6.deinit()
      t8.deinit()
      

      Enjoy and let me know if you hit any issues.
      Pat Deegan

      1 Reply Last reply Reply Quote 3
      • G Offline
        geoff.white
        last edited by

        Is there any chance you could put a copy of the actual firmware up? Building the firmware is well above my skill level at the moment.

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          psychogenic @geoff.white
          last edited by

          Hey @geoff-white,
          Man, I submitted that patch 4 months ago...

          The build process is annoying but not that hard. Still, I can probably get you a bin to burn--main question is how you'll get it on there.

          I was basically using the dev environment's support for updating the firmware, not sure what the process is without it. If you can handle that part, I'll try and do it tomorrow.

          1 Reply Last reply Reply Quote 1
          • G Offline
            geoff.white
            last edited by

            The firmware utility has a load from file option. Who knows if it works?

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              psychogenic @geoff.white
              last edited by

              @geoff-white : guess we'll find out.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom