Ferien Dreams of reni-land
Home
Reed-Kontakt
Arduino
Arduino LCD Display
Arduino Weiche
Lichtschranke
Fotowiderstand
TFT Bildschirm
Arduino UNO WiFi
Arduino Uno/ Uno
Arduino MP3 Player
Arduino LED Strip
Arduino LED Löten
Arduino Karussell
Power Turm Umbau
Flipper Umbau
Verkauf
Faller Motor
 
 
 
 
 
Arduino Programmierung und anschliessen "LDR Fotowiderstand GL5516(Light Dependent Resistor)"
Zubehör:
Arduino Uno
LDR Fotowiderstand GL5516
LED
Widerstand (Fotowiderstand 10k Ohms), (LED 100 Ohms)
 
1.) Fotowiderstand
Kabel mit Widerstand 10k Ohms an Arduino "5 Volt" und 1 Kabel an Pin "A0"

GND an Arduino  "GND"

 

2.) LED

Plus (langer Draht) an Pin 10
Minus and GND
 
Programmcode:

int eingang=A0;

int LED=10;

void setup()
{

Serial.begin(9600);
pinMode (LED,OUTPUT);

}
void loop()
{
sensorwert=analogRead(eingang);

Serial.print("Sensorwert=");
Serial.print(sensorwert);

if(sensorwert > 512) //Wenn der Sensorwert über 512 beträgt….

{
digitalWrite(LED,HIGH);
}
else
{
digitalWrite(LED,LOW);
}
delay(50);
}