Click here to Skip to main content
15,035,283 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
so i've got a code from an article and trying to work through it, it's about implementation of iot in raspberry pi.

there are 4 elements in this project(2leds, 1 sensor & 1 motor as fan) .so i found out in the lines 42-47 that the pins 17,22,27 are used for the three elements but i can't figure out which pin is for sensor ? (the author says the lines 90&91 display sensor readings)

here is the code : https://gist.github.com/mhvn092/8c2fcb391d9afeb09dcc8d3363450fc0

What I have tried:

i asked the question somewhere else too, but people say that in line 73 There is a program that is running the sensor but that is the driver of sensor.
Posted
Comments
markkuk 18-Jun-18 11:14am
   
You have already received the correct answer, the sensor is read in line 73 using an external program. The command line defines that a DHT22 sensor is connected to GPIO 4.
Member 13876913 18-Jun-18 14:06pm
   
ah thank you so much, just a couple more question what is the 22 written before that in that line? is that the voltage pin ? if i wanted to change the pins in the code, i've got to only change that line ? what about that other 3 elements ? just lines 42-47 ?

thanks alot man

markkuk 18-Jun-18 14:19pm
   
"22" is the type of the temperature sensor, see the source code at https://github.com/adafruit/Adafruit_Python_DHT/blob/master/examples/AdafruitDHT.py
Member 13876913 19-Jun-18 11:00am
   
thank you so much man
KarstenK 20-Jun-18 2:11am
   
write it as answer to close the Q&A.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900