Z-Lab/Arduino_Grundlagen/04_Lichtsensor/04_Lichtsensor.ino

16 lines
267 B
Arduino
Raw Permalink Normal View History

2024-12-29 13:55:15 +01:00
int sensorPin = A0;
int ledPin = LED_BUILTIN;
int sensorWert = 0;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
sensorWert = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorWert);
digitalWrite(ledPin, LOW);
delay(sensorWert);
}