An analog sensor is a sensor that gives you a voltage value that represents the measured value.
You can find a lot of different sensors that are analog:
The Arduino has analog inputs that can be used to read these values.With this activity,the students programmed conditional instruction depending on changes of the intensity of light around the board. As a result, a “LED´s Theremin” will be in action when a LDR (Light Dependant Resistor) changes its value of resistance and it was connected to an analogical input of the board.
STEP 1: CONNECT YOUR SENSOR
STEP 2: UPLOAD TEST CODE
STEP 3: READ VALUES
In Spain, we were programming a servomotor with a potentiometer, so when you change the value of the variable resistor (defined in values between 0 and 1023), the servo turns to a new position in degrees (between 0 and 180).
Look at the program wrote by visual blocks an by code text