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

    Ext encoder button

    Units
    2
    3
    840
    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
      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
        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
          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
          • First post
            Last post