Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Rotary Encoder KY-040

Go down  Message [Page 1 of 1]

1Rotary Encoder KY-040 Empty Rotary Encoder KY-040 Sat May 08, 2021 2:24 pm

Mistral



It shows up in a Atmega example so first I tried it with an Arduino, it's easier to do. This example did'nt go nice, when I turn Cw it doesn't count much, when I turn Ccw it counts good.
https://www.handsontec.com/dataspecs/module/Rotary%20Encoder.pdf

The second example same result as above
https://create.arduino.cc/projecthub/vandenbrande/arduino-rotary-encoder-simple-example-ky-040-b78752

And the third is going good
https://www.phippselectronics.com/using-the-rotary-encoder-module-ky-040-with-arduino/

Made some changes in the last program, these lines I commented out:
// if (digitalRead(encoderBtn) == LOW) Serial.println("Button Pressed");
// else Serial.println("Button Released");

and added a carriage return println() here
Serial.print(count);
Serial.print(" | ");
Serial.println(); 


Rotary Encoder KY-040 Unorot10


Very nice to have a few of these components in Simulide, tnx. 
What is causing the difference in behaviour I don't know. These examples are on the top of the list if you do a search for Uno KY-040 but the results are quite different. I posted it here because I don't really need help with it and since it is working in example no.3 it's probably not correct to call it a bug.

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum