Python temperature and relay code
Posted: Sat Apr 09, 2016 9:02 pm
Hi im new to the whole raspberry pi / python coding thing so forgive me if i get anything wrong
I'm trying a little home incubator project using a dht22 temperature sensor as an input to control a 4 channel 5v relay board
I know how to code for the relay board and temperature sensor separately but i want to use them together so i can turn the relay on/off when the temperature reaches a certain threshold.
For the temperature sensor i installed pigpio and used a tutorial to make a simple code that prints the temp/humidity every few second. for the relay board i made a simple on/off code with RPi.GPIO
I tried (and failed) to combine the two codes to control my relay with the temp sensor but it didn't work
I've attached images of the codes and was wondering if anyone with more experience could help me fix it?
I'm trying a little home incubator project using a dht22 temperature sensor as an input to control a 4 channel 5v relay board
I know how to code for the relay board and temperature sensor separately but i want to use them together so i can turn the relay on/off when the temperature reaches a certain threshold.
For the temperature sensor i installed pigpio and used a tutorial to make a simple code that prints the temp/humidity every few second. for the relay board i made a simple on/off code with RPi.GPIO
I tried (and failed) to combine the two codes to control my relay with the temp sensor but it didn't work
I've attached images of the codes and was wondering if anyone with more experience could help me fix it?