Beispiel #1
0
    from DBG_busgo import BusGo
    from DBG_display import Display
else:
    from led_communication import LedCommunication
    from receiver import Receiver
    import RPi.GPIO as GPIO
    from busgo import BusGo
    from display import Display

#********************* Init GPIO
#led_working = 19
#led_power = 22
button_select_in = 19
button_mode_in = 26

GPIO.setmode(GPIO.BCM)
#GPIO.setup(led_power, GPIO.OUT, initial=GPIO.HIGH)
#GPIO.setup(led_working, GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(button_select_in, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(button_mode_in, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

#********************* Init global variables
with open('config.json') as json_data_file:
    config = json.load(json_data_file)['server']

ready_to_shutdown = False
current_mode = 0
automatic_mode = True

_timerCheck = TimerCheck()
Beispiel #2
0
from datetime import timedelta
import time
import os
import json
from weather import Weather
from testled import TestLed
from sensor import Sensor
from timer_check import TimerCheck

#********************* Init GPIO
#led_working = 19
#led_power = 22
button_select_in = 19
button_mode_in = 26

GPIO.setmode(GPIO.BCM)
#GPIO.setup(led_power, GPIO.OUT, initial=GPIO.HIGH)
#GPIO.setup(led_working, GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(button_select_in, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(button_mode_in, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

#********************* Init global variables
with open('config.json') as json_data_file:
	config = json.load(json_data_file)['server']

ready_to_shutdown = False
current_mode = 0
automatic_mode = True

_timerCheck = TimerCheck()