Hi everyone! I'm still a beginner with Arduino and I'm trying to understand how to change the value read by a sensor via serial monitor.
I am attaching a piece of the example sketch
void handleLight() {
light =analogRead(LDR_PIN);
Serial.println(light);
pixels.begin();
lcd.init();
lcd.backlight();
if (light < 700) {
for(int i=0;i<NUMPIXELS;i++)
pixels.setPixelColor(i, pixels.Color(0,255,0));
pixels.show();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Light OK");
delay (1000);
} else { for(int i=0;i<NUMPIXELS;i++)
pixels.setPixelColor(i, pixels.Color(255,0,0));
pixels.show();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Light OFF");
delay (1000);
}
}
I would like to be able to change the value (700) via serial monitor.