MisterBotBreak
Published

How to Make a Light Adjustment System

This project will show you how to make a light adjustment system.

BeginnerFull instructions provided12 minutes1,974
How to Make a Light Adjustment System

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
LED (generic)
LED (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Breadboard (generic)
Breadboard (generic)
×1
Photo resistor
Photo resistor
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Light Adjustment System

Code

Code

Arduino
Light Adjustment System ( code ).
int ledPin1 = A1;
int ledPin2 = A2;
int ledPin3 = A3;
int ledPin4 = A4;
int value;
int light;

void setup() {
 Serial.begin(9600);
}

void loop() {
  value = analogRead(A0);
  Serial.println("Analog Value : ");
  Serial.println(value);
  
  light = map(value, 0, 250, 255, 0);
  analogWrite(ledPin1, light); 
  analogWrite(ledPin2, light);
  analogWrite(ledPin3, light);
  analogWrite(ledPin4, light);
  
  delay(100);
}

Credits

MisterBotBreak

MisterBotBreak

48 projects • 149 followers
I love electronics and cats :D !

Comments