Exemplo n.º 1
0
def main():
    flp.clear()
    flp.print_str("NSFW")
    flp.show()

    print(infotext)
    print("\nPress Ctrl-C to exit.\n")

    wait_for_internet_connection()
    stocks = get_stocks_from_config("stocks.conf")

    flp.glow(period=0.5, duration=4)
    flp.clear()
    flp.show()

    print("Watching Stocks:")
    print("\n".join([
        sym + ": " + share.get_name() + " (" + str(own) + " owned)"
        for sym, own, share in stocks
    ]))

    while (len(stocks) > 0):
        show_latest(stocks)

    print("No stocks...")
    def __display_f(self):
        if self.display_id != self.__display_f:
            flp.set_blink(flp.HT16K33_BLINK_OFF)
            self.display_id = self.__display_f
            #flp.scroll_print("FREEZER")
            flp.print_str("FRZR")
            flp.show()
            time.sleep(2)

        flp.print_float(self.temp_f, decimal_digits=1)
        flp.show()
        flp.glow()
Exemplo n.º 3
0
def cupToPi(data):
    if data is None:
        print(data)
        flp.print_str("BREW")
        flp.show()
        flp.glow(period=1, duration=10)
    else:
        if data is 0:
            flp.clear()
            flp.print_str("0CUP")
            flp.show()
        else:
            num = int(data)
            if num > 9:
                flp.print_str(data + "CP")
                flp.show()
            else:
                flp.print_str(data + "CUP")
                flp.show()
Exemplo n.º 4
0
Arquivo: glow.py Projeto: geofwlkr/clk
#!/usr/bin/env python

import fourletterphat as flp

print("""
Four Letter pHAT: glow.py

This example will glow a message at different speeds and durations.

Press Ctrl+C to exit.
""")

while True:
    flp.clear()
    flp.print_str("P1D4")
    flp.show()
    flp.glow(period=1, duration=4)

    flp.print_str("P4D8")
    flp.show()
    flp.glow(period=4, duration=8)
Exemplo n.º 5
0
#!/usr/bin/env python

import fourletterphat

print("""
Four Letter pHAT: glow.py

This example will glow a message at different speeds and durations.

Press Ctrl+C to exit.
""")

while True:
    fourletterphat.clear()
    fourletterphat.print_str("P1D4")
    fourletterphat.show()
    fourletterphat.glow(period=1, duration=4)

    fourletterphat.print_str("P4D8")
    fourletterphat.show()
    fourletterphat.glow(period=4, duration=8)