#define LDR 2
#define LED 3
void setup() {
// put your setup code here, to run once:
pinMode(LDR, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(LDR) == 1)
digitalWrite(LED, HIGH);
else
digitalWrite(LED, LOW);
delay(1); // this speeds up the simulation
}
Loading
pi-pico-w
pi-pico-w