Example #1
0
def display_dht11():
    global temp, humi
    gfx.text("Sensor", 0, 0, gfx.YELLOW, gfx.BLACK)
    # Convert celsius to fahrenheit
    ctf = (temp * 9 / 5) + 32
    gfx.text_long("", "", "Temp = {0:0.1f}F".format(ctf),
                  "Humidity = {0:0.0f}%".format(humi), "", "", "", "")
Example #2
0
def display_dht11():
    global temp, humi
    tft.text(font, "Sensor", 0, 0, st.YELLOW, st.BLACK)
    # Convert celsius to fahrenheit
    ctf = (temp * 9 / 5) + 32 - 4  # -4 was calibration for my sensor
    gfx.text_long("Sensor", "", "Temp = {0:0.1f}F".format(ctf),
                  "Humidity = {0:0.0f}%".format(humi), "", "", "", "",
                  st.WHITE, st.BLACK)
Example #3
0
def info():  # Get and display Info # SCREEN 2

    ip = "Wifi Off"

    mfreq = str(machine.freq())
    raw = str(esp32.raw_temperature())

    gfx.text_long("Info", "", ip, "CPU temp = " + raw + "F", "", mfreq, "", "")
    gc.collect()
Example #4
0
def showlogo():
    gfx.text_long("Colors", "", "", "", "", "", "", "")

    gfx.text("    ", 0, 18, gfx.BLACK, gfx.BLACK)
    gfx.text("Red", 0, 34, gfx.RED, gfx.BLACK)
    gfx.text("Blue", 0, 50, gfx.BLUE, gfx.BLACK)
    gfx.text("White", 0, 66, gfx.WHITE, gfx.BLACK)
    gfx.text("Green", 0, 82, gfx.GREEN, gfx.BLACK)
    gfx.text("Magenta", 0, 98, gfx.MAGENTA, gfx.BLACK)
    gfx.text("Cyan", 0, 114, gfx.CYAN, gfx.BLACK)
Example #5
0
def draw():
    while True:
        global alarm_0
        # gfx.triangle(43, 30, 40, 90, 80, 120, st.color565(200,200,200))

        ddd = debug.showVoltage()
        rrr = debug.raw_temp()
        fff = debug.m_freq()

        A = alarm_0 + 1

        gfx.text_long("Sensor", ddd, rrr, "", fff, "", "", A, st.WHITE,
                      st.BLACK)
        utime.sleep_ms(1000)
Example #6
0
def dfree():  # Display remaining free space # SCREEN 3
    # am = str(alarmc1)

    bits = statvfs('/flash')
    # print(str(bits))
    blksize = bits[0]  # 4096
    blkfree = bits[3]  # 12
    freesize = blksize * blkfree  # 49152
    mbcalc = 1024 * 1024  # 1048576
    mbfree = freesize / mbcalc  # 0.046875
    freestr = str(mbfree)

    gfx.text_long("Space(MB)", "Curr: " + freestr, "", "Old:  " + "1.949219",
                  "", "", "", "", st.WHITE, st.BLACK)
    gc.collect()
Example #7
0
def scralarm():
    gfx.text_long("Screen", "Alarm_1 = ", "var", "", "", "", "", "", st.WHITE,
                  st.BLACK)
Example #8
0
def scralarm():
    gfx.text_long("Screen", "", "Alarm_1 = ", str(alarm_0), "", "", "", "")
    gfx.text("Blue", 0, 98, gfx.BLUE, gfx.BLACK)
Example #9
0
def draw_shapes():  # Test draw screen
    gfx.text_long("Screen 4", "", "", "", "", "", "", "")