Led Controlled by Potentiometer using Arduino - Wired Connection | Arduino


Circuit Diagram:


 Required components:

Arduino Uno/Nano: 1 Nos
Led light - 1 Nos
470k resister - 1 Nos
Potentiometer - 1 Nos


Program Code: 


    int ledPin = 6;
    int potentiomenterInput = A1;
    
    void setup()  {
      pinMode(ledPin, OUTPUT);
    }
    
    
    void loop()  {
    
      potentiomenterInput = (analogRead(A1)); // Divides input 0-1023 to resemble to 0-255
    
      analogWrite(ledPin, potentiomenterInput);
      // The delay can be change to get the desired dimming effect
      delay(50);                           
    }

Video:





Comments

Popular posts from this blog

Servo motor controlled by Joystick using Arduino & Transceiver - Wireles...

DC motor controlled by Joystick using Arduino & L298N Motor driver - Wireless Connection

DC motor controlled by Gyro MPU 6050 using Arduino & L298N Motor driver - Wired Connection