Hello everyone!! Welcome to this post on Arduino Projects!!
Need a short introduction to what the Arduino is then click on LINK
Check out the breadboard intro right HERE
So in this project we’ll make a LED brightness controller using a potentiometer (variable resistance)
Demo:
So this is what my project looks like:
Things Required:
- Arduino UNO
- USB AB cable
- LED (any color)
- 10 k ohm resistor
- Breadboard
- 220 ohm resistor
- Arduino IDE on computer
- jumper wires
Important Concepts:
Functions used:
Code:
int pot_val;
float led_val;
int led_pin=9;
int pot_pin=A0;
void setup() {
// put your setup code here, to run once:
pinMode(pot_pin, INPUT);
pinMode(led_pin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
pot_val= analogRead(pot_pin);
led_val= (255.0/1023.0)*pot_val;
analogWrite(led_pin, led_val);
}
Stay Tuned for upcoming posts on Arduino Projects! We’re on the basic newbie projects right now and slowly, gradually move on to those cool, ultra techy projects!! Want to be the first to know when a new and amazing post comes up?? Then feel free to subscribe!
Happy Learning!!
