The analog input is read and the result is printed in the Serial Monitor. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, analogRead()
returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Analog Read Serial
This example demonstrates how to read analog input from a potentiometer.
Comments
Please log in or sign up to comment.