def clock(): lcd.move_to(5, 1) lcd.putstr(get_hhmm(":")) sleep(0.5) lcd.move_to(5, 1) lcd.putstr(get_hhmm(" ")) sleep(1)
def clock(): clt() print(get_hhmm(":")) sleep(1) clt() print(get_hhmm(" ")) sleep(1)
def oled_clock(): timeString = get_hhmm() hh = int(timeString[:2]) mm = int(timeString[3:5]) fourDigits(o, hh, mm) sleep(0.5) fourDigits(o, hh, mm, 0) sleep(0.5)
def timeDisplay(): xt = 88 # display time possition yt = 38 if not isOLED: return try: oled.fill_rect(xt, yt, xt + 50, yt + 10, 0) oled.text(get_hhmm(), xt, yt) oled.show() except Exception as e: print("timeDisplay() Exception: {0}".format(e))
# octopusLAB simple example # ESP32board with "BUILT_IN_LED" and OLED display import machine from time import sleep from util.octopus import Env, w, time_init, get_hhmm, get_hhmmss from util import printTitle isOled = False isDisp7 = True printTitle("examples/deep_sleep1.py") from util.led import Led led = Led(2) if get_hhmm() == "00:00": print("first time setup > ") w() time_init() print(get_hhmmss()) def sendValue(val=0, urlPOST="http://your_server/add_item_to_database.php"): from urequests import post header = {} header["Content-Type"] = "application/x-www-form-urlencoded" deviceID = Env.uID place = "octoPy32" value = int(float(Env.ver) * 100) try: postdata_v = "device={0}&place={1}&value={2}&type={3}".format(
def clock(): d7.show(get_hhmm("-")) sleep(0.5) d7.show(get_hhmm(" ")) sleep(0.5)