const int lr = 13;
const int lb = 12;
const int lg = 11;
const int ly = 10;
const int pot = A0;
int potValue = 0;
void setup() {
pinMode(lr, OUTPUT);
pinMode(lb,OUTPUT);
pinMode(lg, OUTPUT);
pinMode(ly, OUTPUT);
pinMode(pot, INPUT);
Serial.begin(9600);
}
void loop() {
potValue = analogRead(pot);
//Serial.println(potValue);//
if (potValue >=300){
digitalWrite(lr, HIGH);
Serial.println("low charge! 25%");
}
else {
digitalWrite(lr,LOW);
}
if (potValue >=500){
digitalWrite(lb, HIGH);
Serial.println("50% completed");
}
else {
digitalWrite(lb, LOW);
}
if (potValue >=800){
digitalWrite(lg, HIGH);
Serial.println("75% Completed");
}
else {
digitalWrite(lg, LOW);
}
if (potValue >1000){
digitalWrite(ly, HIGH);
Serial.println("100% Completed");
}
else {
digitalWrite(ly, LOW);
}
}