I'm glad I bought the HAT board and temperature sensor, but it wasn't working, so I went instead of verifying the operation.
Price etc.
Refer to Seeed Studio Product Page Enter the following command to set up.
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
After waiting for a while, the following message will be displayed.
Successfully installed grove.py-0.6
#######################################################
Lastest Grove.py from github install complete !!!!!
#######################################################
Refer to Seeed Studio Product Page Connect the sensor to the Hat-based PWM.
Install the library with the following command.
git clone https://github.com/Seeed-Studio/Seeed_Python_DHT.git
cd Seeed_Python_DHT
sudo python setup.py install
After installation, the following message will be displayed.
Installed /usr/local/lib/python2.7/dist-packages/seeed_python_dht-0.0.1-py2.7.egg
Processing dependencies for seeed-python-dht==0.0.1
Finished processing dependencies for seeed-python-dht==0.0.1
The sample code is in the folder you copied from git, so run it
python examples/dht_simpleread.py
When executed, the temperature and humidity are returned as follows.
DHT11, humidity 66.0%, temperature 23.0*
DHT11, humidity 68.0%, temperature 21.0*
DHT11, humidity 74.0%, temperature 21.0*
DHT11, humidity 74.0%, temperature 21.0*
Refer to the following site for the program to measure temperature with go https://github.com/d2r2/go-dht
Add the following modifications in the sample code of example1
sensorType := dht.DHT11
pin := 12
If you run it as a root user, you can measure temperature and humidity.
Recommended Posts