Jun-24-2018, 05:35 PM
(This post was last modified: Jun-24-2018, 05:35 PM by gontajones.)
from mySensorModule import read_sensor from mySensors import sensorsID import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.OUT) # accessing a dictionary: dict_name[key] = value sID1 = sensorsID['solar_panel'] sID2 = sensorsID['cyl_bottom'] x = 5 try: while True: # Here you have to use the IF-ELSE if read_sensor(sID1) + x > read_sensor(sID2): GPIO.output(25, GPIO.HIGH) print("it's Hot!") else: print("Got it wrong again Dad") GPIO.output(25, GPIO.LOW) time.sleep(1) except KeyboardInterrupt: GPIO.cleanup()