Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int LDR = A5;
- int lux = 0; // Note the value from the sensor is not the real lux value ;-) max value is 1023.
- void checkLight() {
- lux = analogRead(LDR);
- if (lux < 400) {
- analogWrite(headLights, 255);
- } else {
- analogWrite(headLights, 10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment