Khaled Md Saifullah
Published © MIT

Arduino Basic Project-#5

This is a simple project on Arduino with potentiometer and led.

BeginnerFull instructions provided30 minutes692
Arduino Basic Project-#5

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Rotary Potentiometer, 10 kohm
Rotary Potentiometer, 10 kohm
×1
5 mm LED: Red
5 mm LED: Red
×1
Jumper wires (generic)
Jumper wires (generic)
×5

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

Arduino-Basic-Project-#3-fritzing-file

Schematics

Arduino-Basic-Project-#5-circuit-diagram

Code

Arduino-Basic-Project-#5-code

Arduino
// Date: 18/11/21
// Khaled Md. Saifullah
// KastTech

int potPin= A0;
int LEDPin= 9;
int potValue;
int colorLevel;

void setup() {
  pinMode(potPin, INPUT);
  pinMode(LEDPin, OUTPUT);
  Serial.begin(9600);
}
 
void loop() {
  
 potValue = analogRead(potPin);
 colorLevel = map(potValue,1,1024,1,255);
 analogWrite(LEDPin, colorLevel);
 Serial.print("The value of Resistance is: ");
 Serial.println(colorLevel);
}

Credits

Khaled Md Saifullah

Khaled Md Saifullah

18 projects • 44 followers
🦸Tech Enthusiast 👨🏾‍💻Programmer 📳IoT Specialist

Comments