LDR Sensor & Arduino using Tinkercad

preview_player
Показать описание
In this video, we will see the interfacing of Light Dependent Resistor (LDR) Sensor or Photo-resistor with Arduino in Tinkercad.

#ldrsensor #arduino #tinkercad #photoresistor
Рекомендации по теме
Комментарии
Автор

Excellent video, helped a lot!
Heres the code he uses:

const int LEDPin = 13;
const int LDRPin = A0;

void setup()
{
Serial.begin(9600);
pinMode(LEDPin, OUTPUT);
pinMode(LDRPin, INPUT);
}

void loop()
{

int LDRStatus = analogRead(LDRPin);

if (LDRStatus <= 500)
{
digitalWrite(LEDPin, HIGH);
Serial.println(LDRStatus);

}
else
{
Serial.println(LDRStatus);
digitalWrite(LEDPin, LOW);
}
}

sinforoso
Автор

why do you need to add resistor to the grounded cable/wiring?

allan
welcome to shbcf.ru