Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
KRIVANJADIYables
Published © GPL3+

Working with a Potentiometer and an LED

Use of a potentiometer to control brightness of an LED.

BeginnerProtip34,061
Working with a Potentiometer and an LED

Things used in this project

Story

Read more

Schematics

Circuit Diagram

Schematic Diagram

Breadboard Diagram

Code

Code

Arduino
const int analog_ip = A0;
const int LED = 3;
int inputVal = 0;

void setup() {
  pinMode (LED, OUTPUT);
}

void loop() {
  inputVal = analogRead(analog_ip);
  analogWrite (LED, inputVal/4);
  delay(100);
}

Credits

KRIVANJA
37 projects • 52 followers
www.krivanja.dev
DIYables
0 projects • 80 followers
I would like to invite you to join and add your projects to DIYables platform https://www.hackster.io/diyables

Comments