Sooner or later you will need to tell you Arduino
to change a setting. For example:
You want to change time to alarm on your new Arduino
sunrise simulating alarm clock.
You have several options, that include digital or analog inputs
on the microcontroller.
You can use a simple switch, a potentiometer, or my preferred way, a
rotary encoder with a push-button. This thing right here.
This one has 18 pulses and
36 detents per revolution, and the push button and costs around 2.50 €.
A pulse is this coming into the Arduino and a detent is a subtle click when you revolve the axle.
How to use it?
My preferred way is to use this library, and keep in mind that you might have
a problem with installing it, so check the hint
in the description.
Special thanks to Paul Stoffregen for developing this amazing library.
This is the wiring diagram.
What I want you to notice is the ground wiring to the pins.
First I wired it reverse and couldn't get it to work for a couple of hours.
I guess it would be easier if I actually read the library's documentation.
When you wire the encoder and install the library, it is best to open an example like this one.
When you rotate one way the value increases turn the other way,
it decreases. The push button has four useful options with this library.
Click, double-click,
hold and release after hold.
For example, I use this encoder to navigate my cycling machine parameters.
Click to move forward, double click to go back digit,
rotate one way, to increase and the other to decrease the parameter.
Hold to display that the cycles are being reset and when I release, the reset is executed.
Next we will start using OLED displays
