
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

int ldrPin = A0; int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { int light = analogRead(ldrPin); Serial.println(light); if (light > 500) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } delay(200); }