inni1012
Published

LED Basics: Dim or Increase brightness with an LED!

Using Arduino UNO, 1 - LED, 1 - potentiometer, 1 - 220 ohm resistor, and 6 male to male jumper wires.

BeginnerProtip38
LED Basics: Dim or Increase brightness with an LED!

Things used in this project

Hardware components

Cytron Technologies Potentiometer/ Finger Adjust Preset
×1
Male/Male Jumper Wires
×1
LED (generic)
LED (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
×1

Story

Read more

Schematics

Project Schematics

Code

Project Code

Arduino
#define LED_PIN 11
#define POTENTIOMETER_PIN A1
void setup()
{
  pinMode(LED_PIN, OUTPUT);
}
void loop()
{
  int potentiometerValue = analogRead(POTENTIOMETER_PIN);
  int brightness = potentiometerValue / 4;
  analogWrite(LED_PIN, brightness);
}

Credits

inni1012

inni1012

1 project • 0 followers

Comments