Вернуться на страницу библиотеки модулей
const int sensorPin = A2; // KY-018 signal pin → Arduino A2
void setup() {
Serial.begin(9600);
}
void loop() {
int value = analogRead(sensorPin); // 0 (dark) – 1023 (bright)
Serial.println(value);
delay(100);
}
Рекомендованные ссылки:
Arduino Photoresistor Module KY-018 (HW-486) — Pinout, Wiring & Code
KY-018 Photoresistor – SensorKit
KY-018-Joy-IT.pdf
Using the Photoresistor Module KY-018 with Arduino – Phipps Electronics
ESP32 KY-018 Photoresistor Module Pinout & Datasheet
Arduino – Photo Resistor Example – KY-018 – Instructables
Вернуться на страницу библиотеки модулей