The sensor seems to only work with python. I follow the instructions in the manual and have it wired the exact same way. I am using a rasbpberry pi 3 model B.
here is the output i get for both
pi@raspi2:~/lessons$ python 15_dht11.py
sensor is working.
[0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0]
temperature : 19 , humidity : 65
pi@raspi2:~/lessons/15-dht11$ gcc dht11.c -o dht11 -lwiringPi
pi@raspi2:~/lessons/15-dht11$ ./dht11
Raspberry Pi wiringPi DHT11 Temperature test program
Data not good, skip
Data not good, skip
Data not good, skip
^C
Im using gpio 1 plus 5v and gnd as in the lesson. Works fine with python but C wont work
Any idea?
|