Arduino basics 2: dimming led with potentiometer

Arduino basics 2: dimming led with potentiometer

dim the brightness of your led with potentiometer and understand the basics of Arduino Required components: 1. Arduino uno : https://www.amazon.in/Arduino-ATmega3... 2. 10k potentiometer : http://amzn.to/2owaGYz 3. led : http://amzn.to/2nCYW6C 4. 220 ohm resistor : http://amzn.to/2ogQGMt 5. jumper wires 6. breadboard circuit: resistor - +ve of led +ve of led - 9 of Arduino -ve of led - gnd of Arduino middle of potentiometer - A0 of Arduino left of potentiometer - 5V of Arduino right of potentiometer - gnd of Arduino code: int analogPin = A0; int ledPin = 9; int inputValue = 0; int outputValue = 0; void setup() { // put your setup code here, to run once: } void loop() { inputValue = analogRead(analogPin); outputValue = map(inputValue,0,1023,0,255); analogWrite(ledPin, outpu