The document defines variables for 3 LED pins and an LDR pin, sets the pins as outputs in setup, and uses analogRead to check the LDR value in loop to light different LEDs depending on the LDR reading.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views
Arduino
The document defines variables for 3 LED pins and an LDR pin, sets the pins as outputs in setup, and uses analogRead to check the LDR value in loop to light different LEDs depending on the LDR reading.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
int pinLed1 = 11;
int pinLed2 = 12;
int pinLed3 = 13;
int pinLDR = A0;
int valorLDR = A0;
void setup() { pinMode(pinLed1, OUTPUT); pinMode(pinLed2, OUTPUT); pinMode(pinLed3, OUTPUT); // put your setup code here, to run once: Serial.begin(9600); } void loop() { digitalWrite(pinLed1, LOW);// put your main code here, to run repeatedly: digitalWrite(pinLed2, LOW); digitalWrite(pinLed3, LOW);