Working with a Potentiometer and Two LEDs

Working with a Potentiometer and Two LEDs © GPL3+

This project demonstrates the use of a potentiometer to control two LEDs.

  • 138 views
  • 0 comments
  • 1 respect

Components and supplies

Apps and online services

About this project

This project demonstartes the use of Potentiometer to controltwo LEDs.

Also Visit

Objective:

To control two LEDs with a potentiometer. (One Fade-IN and other Fade-OUT)

Working with a Potentiometer and two LEDs

Code

CodeArduino
const int analog_ip = A0;
const int LED1 = 3;
const int LED2 = 9;
int inputVal = 0;

void setup() {
  pinMode (LED1, OUTPUT);
  pinMode (LED2, OUTPUT);
}

void loop() {
  inputVal = analogRead(analog_ip);
  analogWrite (LED1, inputVal/4);
  analogWrite (LED2, (1023-inputVal)/4);
  
}

Schematics

Circuit Diagram
Workingwithpotentiometerandtwoleds circuit 2ielsbwdr6
Schematic Diagram
Workingwithpotentiometerandtwoleds schematic nx6x2f87f0
Breadboard Diagram
Workingwithpotentiometerandtwoleds 7n94ikch0x

Comments

Similar projects you might like

Working with Shift Register

by SBR

  • 3,468 views
  • 2 comments
  • 8 respects

Arduino Door Bell with 3 LEDs

Project showcase by abhishekghosh

  • 4,537 views
  • 2 comments
  • 7 respects

Blinking LEDs with Arduino

Project tutorial by Super Kid

  • 3,862 views
  • 2 comments
  • 17 respects

Switching Using Transistor

by SBR

  • 7,817 views
  • 15 comments
  • 36 respects

Arduino Burglar

Project showcase by paolo_cravero

  • 3,948 views
  • 2 comments
  • 8 respects

Turn LEDs On/Off via Remote Control

Project tutorial by ismystore

  • 9,135 views
  • 1 comment
  • 8 respects
Add projectSign up / Login