I am developing for the NodeMCU V0.9 with the NonOS SDK and can't get it to communicate to a DHT22 sensor.
Wiring: 3.3V on NodeMCU -> + on DHT22, Ground to - and pin D1 to signal, there is a 6.8k pull up resistor on the data line.
According to the DHT22 datasheet, the MCU has to start by pulling the data line low for a bit more then 1 ms after having it on high for 1 ms and then hast to listen to what the DHT22 is sending.
My code for doing this is the following:
gpio_output_set(_pinNumber, 0, _pinNumber, 0); os_delay_us(START_SET_HIGH_TIME_US); gpio_output_set(0, _pinNumber, _pinNumber, 0); os_delay_us(START_SET_LOW_TIME_US); gpio_output_set(0, 0, 0, _pinNumber);
I ruled out a defective DHT22 by trying 3 different ones. The DHT22 doesn't answer with the data as expected.
Has anyone encountered this behavior?