Incomplete code example for rotary encoders

Hi guys.

This page: https://core-electronics.com.au/tutorials/how-to-use-rotary-encoders.html has some code to demonstrate use of rotary encoders. The very first line is:
#include

but #include what? I’ve had a very frustrating day trying to work out how to use these devices reliably.

Please advise.

Hi Mike,

Thanks for pointing that out! Sometimes unexpected things happen when copying Arduino code into html :slight_smile:

I’ve corrected the code in the tutorial for you. You will need to go to “Manage Libraries” and install the “Encoder” library for these examples to work. Liquidcrystal should be installed by default.

If you want a more in depth example of how to get them to work, here is a great reference: https://playground.arduino.cc/Main/RotaryEncoders

Good luck with your project!

Thanks Stephen. In the meanwhile I’ve found the core of a sketch and heavily modified (ah hem… fixed it :slight_smile: ) to function to my requirements. I am well aware of how ‘copy and paste’ can go very wrong.

Regards,

Mike

1 Like