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

21 lines
272 B
Arduino
Raw Normal View History

2024-12-29 17:18:32 +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);
}