0

I am trying to learn how to use a Rotary Encoder together with an LCD display where I can use the encoder to choose Letters that will be printed in the LCD. enter image description here

This is the kind of result I should be getting, but instead I am getting this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

c d e f 0 1 2 3 4 5 6 7 8 9 a b

10 00 10 00 11 01 11 01 10 00 10 00 11 01 11 01

A: 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0

B: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

Shouldn't I be getting a sort of 001100110 100110011 pattern to be able to tell which way it is rotated? How can I fix this? I am using the following connections: enter image description here

  • 1
    I don't understand what you mean with these patterns. Please explain more, how you get to those patterns and what exactly you didn't expect – chrisl Sep 6 '19 at 9:12
  • 4
    How are we supposed to know what's wrong with your code if we can't see it? – Edgar Bonet Sep 6 '19 at 9:22
  • you are misunderstanding how to use the encoder ... you do not read the two bits and look for patterns ... you wait for A to change ... that tells you that the encoder moved ... the state of B at the time of the change tells you the direction of rotation ... to make it simple, look for only the rising edge of signal A – jsotola Sep 6 '19 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.