Finally I can go up from blink to another basic of Arduino. In this circuit we can control the brightness of LED with potentiometer.LED brightness is determined from the position knob on the potentiometer.
Some material we need:
- Arduino (I am using Arduino UNO)
- Potentiometer 10K ohm
- 330 Ohm resistor
- 6 jumperwire
- Data cable from Arduino to PC
the new things we learn in here is "sensorPin =A0". It means that we select the input pin for the potentiometer. To read the value from the sensor we just type "sensorValue = analogRead(sensorPin);" inside the loop.