Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Encoder library velocity sense and debounce

  1. #1

    Encoder library velocity sense and debounce

    Hi - I have a few questions about the included encoder library. Is there and encoder debounce included . Do I need to worry about the encoder bouncing on state changes ? Also, if I wanted to implement velocity sense and Iím using the library with interrupt pins do I just let the library do itís thing and then read the encoder count over time in the main loop and then change the stored value by a larger increment ?

  2. #2
    Senior Member
    Join Date
    Apr 2017
    Posts
    115
    I wouldn’t worry about trying to denounce encoders in software, it’s more like a rabbit hole, you’ll have much better results Debouncing in hardware and less headache. As for velocity, that’s what I recently did when experimenting with it, I reset the encoders value back to 0 after every time I read it and using this method of resetting it you can easily get acceleration depending on how far from 0 the encoder object reads when you turn it. Then it’s just a matter of determining how you want to accelerate it, you can keep it one to one or you can find an equation that feels natural to you, just experiment with a few things.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •