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

    Ext encoder button

    Scheduled Pinned Locked Moved Units
    3 Posts 2 Posters 2.6k Views
    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.
    • L Offline
      louisandthecat
      last edited by

      Hi all

      I’ve successfully got a KY040 rotary encoder working with the m5Stack ext- encoder unit.

      I can register rotations but the part I haven’t made work is the push button - which is a straightforward contact button

      There is an input for it on the ext encoder marked as Z but I can’t find any documentation on how I read this button and there seem to be no functions in the class to handle it.

      Does anyone have any idea how I handle this?

      Thanks in advance

      teastainT 1 Reply Last reply Reply Quote 0
      • teastainT Offline
        teastain @louisandthecat
        last edited by teastain

        @louisandthecat
        In robotics and CNC the Z input is the third phase of the encoder usually to tell the controller that you have gone around once.
        You have a KeyStudio encoder with only two phases and the third is the press to click.
        The library reads this as:
        #define UNIT_EXT_ENCODER_ZERO_PULSE_VALUE_REG 0x60
        #define UNIT_EXT_ENCODER_ZERO_MODE_REG 0x70
        Pushing it should Zero out the counts.
        What controller are you using?
        And what IDE are you programming in?

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        L 1 Reply Last reply Reply Quote 1
        • L Offline
          louisandthecat @teastain
          last edited by

          @teastain Thank you - I had misunderstood what the Z was for. Because on the ky040 the middle pin is for the "switch" functionality (i.e. pushing down on the encoder) I assumed it was for this. I realise now that I need to treat that as a button and take it off to a different pin, which I know how to do.

          Thanks for your help!

          1 Reply Last reply Reply Quote 2

          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
          • First post
            Last post