Exemple #1
0
#   LCD + DHT11:  http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/
#   GPIO: https://tutorials-raspberrypi.com/raspberry-pi-control-relay-switch-via-gpio/
#   Touch_Callback: https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
######################

#################
# HARD CODE PINS FOR SENSORS
RELAY_PIN_1 = 16
RELAY_PIN_2 = 18
RELAY_PIN_3 = 22
TOUCH_PIN = 13
LIGHT_PIN = 11
TEMP_HUMID_PIN = 22  #This is the GPIO pin. Other pins set using BOARD
#################

lcd = LCD.LCD_Display(rs=37, e=35, data_pins=[33, 31, 29, 23])
light = light_sensor.READ_LIGHT_SENSOR(pin=LIGHT_PIN)
temp_humid = temp_humid.READ_DHT11(pin=TEMP_HUMID_PIN)
r1 = relay_switch.relay_switch(pin=RELAY_PIN_1)
r2 = relay_switch.relay_switch(pin=RELAY_PIN_2)
r3 = relay_switch.relay_switch(pin=RELAY_PIN_3)
temperature = ds18b20.ds18b20()


def change_display():
    global display_num
    global in_temp_f
    global in_humid
    global out_temp_f
    global condition
    if display_num == 1: