예제 #1
0
def setup():
    global lcd_brightness
    lcd.setRotation(1)
    axp.setLcdBrightness(lcd_brightness)
    lcd.clear(0x000000)
    lcd.set_bg(0x070707)

    year = time.localtime()[0]
    if year < 2001:
        wifi = connectToWifi()
        if wifi.active():
            updateRTC(toffset=3600)
            wifi.active(False)
        time.sleep(3)

    lcd.clear(0x000000)
예제 #2
0
        stadevTObjecto = statistics.pstdev(listTObject)
        stadevTAmbient = statistics.pstdev(listTAmbient)

        #if( (max(listTObject) < meanTObjecto+0.5) and (min(listTObject) > meanTObjecto-0.5)):
        if (stadevTObjecto > 5):
            print("Tente de novo, fique parado a 3 cm")
        else:
            print("Media da temperatura = {} °C".format(meanTObjecto /
                                                        100))  # incerteza ???
            if (meanTObjecto > 3700):
                print("FEBRE - procurar o sistema de saúde")

            # Saida no M5StickC
            lcd.clear()
            lcd.setRotation(3)
            tempfield = M5TextBox(40, 20, "35.23", lcd.FONT_DejaVu40, 0xfee203)
            clabel = M5TextBox(54, 64, "+/- 0.5 Celsius", lcd.FONT_Default,
                               0xfee203)
            titlelabel = M5TextBox(0, 0, "M5StickC MLX90615", lcd.FONT_Small,
                                   0xFFFFFF)

            tempfield.setText(str(meanTObjecto))
            clabel.setText("+/- " + str(stadevTObjecto) + " Celsius")
            print('(' + str(meanTObjecto) + " +/- " + str(stadevTObjecto) +
                  ") Celsius")

        sleep_ms(TIME_MS_AFTER_TEMPERATURE_MEASUREMENTS)
        print(
            "mensagem para se afastar do medidor, tal que a temperatura do objeto volte a ser próxima da temperatura ambiente"
        )
예제 #3
0
def clrscrn(rot=1):
	lcd.setRotation(rot)
	lcd.clear()
	lcd.font(lcd.FONT_DejaVu24)
	lcd.setTextColor(lcd.WHITE)
	lcd.setCursor(0,0)
예제 #4
0
 def run():
     seed(ticks_cpu())
     lcd.setRotation(3)
     Snake.timer.init(period=Snake.speed,
                      mode=Timer.PERIODIC,
                      callback=Snake.move)
예제 #5
0
def Demo():
    lcd.setRotation(3)
    lcd.clear()
    lcd.font(lcd.FONT_UNICODE)
    t = Ticker("This is a very long text", 0xffffff, sliding=False, delay=2)
    tt = Ticker("The line can be longer and can go faster and can even have unicodэ symbols", 0x85fa92, y=20, speed=100, delay=10)