Exemplo n.º 1
0
def loop():
    space = '                '
    greetings = 'Thank you for buying SunFounder Sensor Kit for Raspberry! ^_^'
    greetings = space + greetings
    while True:
        tmp = greetings
        for i in range(0, len(greetings)):
            LCD.write(0, 0, tmp)
            tmp = tmp[1:]
            time.sleep(0.8)
            LCD.clear()
Exemplo n.º 2
0
import actuadors

if __name__ == "__main__":
    actuadors.initGpio()
    LCD.initialScreen()
    serials.initSerial()
    count = 0
    timeout_door_open = 0
    timeout_send_thingspeak = 0

    while True:
        if count <= 100:
            time.sleep(.01)
            count = count + 1
        else:
            LCD.clear()
            LCD.printMessage("Temp: ")
            LCD.printMessage(str(sensors.TemperatureGet()))
            if timeout_send_thingspeak > 100:
                timeout_send_thingspeak = 0
                thingspeak.upload(sensors.TemperatureGet())
            serials.write("sendet\n\r")
            timeout_send_thingspeak = timeout_send_thingspeak + 1
            print timeout_send_thingspeak
            count = 0

        read = serials.receiveByte(1)
        if read >= 'A':
            print read
            actuadors.setLamp(read)
            read = 0