Closed Gettyk closed 5 years ago
You need the SoftwareSerial library to communicate with the sensor.
SoftwareSerial sensor(rxpin, txpin);
Then in the setup loop type:
sensor.begin(9600);
Search for it on Google and you’ll see.
Example updated and Readme updated. Should work now.
Hi, I am sorry to bother you but I am just starting with NodeMCU and I have trouble understanding which pins I should use with my NodeMCU. You write:
But this is for the Arduino. Which are the 3 pins (all except the Ground) that I should use if I have this pinout:
Is it the NodeMCU VIN for the MH-Z19 Vout, the NodeMCU RX (GPIO3) for the MH-Z19 Rx and the NodeMCU RX (GPIO1) for the MH-Z19 Tx. I have seen other sketch using D6 and D7 or D1 and D3, so I am really confused.
Thanks a lot!