Home
Articles
Projects
LDR + LED
const int LED = 9;
const int LDR = A0;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
int a0 = analogRead(LDR);
int light = max(map(a0, 0, 600, 1023, 0), 0);
analogWrite(LED, light);
delay(300);
}
최근 게시물
이전 게시물
홈