Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Emre Aladag
#76095 Hi,

I have NodeMCU v3, a LED and a PIR unit.

I try to turn on led with the value of PIR, following tutorial http://www.electronicwings.com/nodemcu/pir-interfacing-with-nodemcu:
Code: Select allint LED = D4;
int PIR_Input = D1;

void setup(){
 pinMode(PIR_Input,INPUT);
 pinMode(LED,OUTPUT);
}

void loop() {
 digitalWrite(LED, digitalRead(PIR_Input));
}


However the builtin blue LED and my green led are blinking interchangeably (green turns on, stays for 1 sec, turns off and built-in blue turns on, stays for 1 second, turns off, green turns on. ..). Any ideas why it's behaving like that? It does not care about motion.