******************************* WioClock.py (text) ******************************* by D@CC on 2023 D Apr 02 This is an operational clock that runs on the Wio Terminal. But it is difficult to setthe time on this clock. The Wio Terminal needs to either: -be supplied with power via USB-A or -be accompanied by a Wio Battery. #by D@CC on: 2023DApr05 (tested by D@CC) #Purpose: to display the (UNIX) clock on the WioTerminal #Common Name: WioClock #Method Invoked improvised function (not as main.py) #Comment: This is my first useful program for the Wio Terminal #Versioned Name: WioClock_v02o^^_2023DApr05.py #Versioned Name: occurs: 3 times top, def, #def end, invocation #Requirements: ArduPy_wio_terminal_lastest.uf2 (MicroPython) # This program restarts unattended & unconnected. #Device-related: If device="RPi",this program works fine. # If device="RPi" Unix time remove fractional seconds #Issues: 1. L should sense device to work on the RPi # 2. M should use wifi on the RPi # 3. Ishould show HH:M1 in large block letters # 4. M should allow the user to adjust the time # 5. L should allow the user to specify screen dimensions # 6. M should allow writing/reading time from uSD card # 7. L Some of the main parameters should become # external to the program code # 8. L The serial file read should really be in a function # that uses a grep-like function. # 9. M I plan to build versions of it using wioBuild: # wioBuild WioClock_v02o03_2023DApr04 f o # where f points to a function directory and # where o points to the output file name(s) # 10. L A future version will get time from wifi # 11. L How can colored text or background be printed? # 12. M Should use the isDevice() function # 13. L No strip() in MicroPython (I have a work-around function. # 14. M EST cannot be changed (as of 2023DApr06) #Description: 1. prints progname & minicom cmd # 2. requests current UnixTime (deprecated)) # 3. Doesn't yet use device but reads GMT Unix Time from disk # 4. CLS then displays updated clock every 5 seconds # 5. Version WioClock_v02o10_2023DApr05 (stable) works fine # 6. It starts up with GMT Unix Time from the Flash Drive at # media/rtc/previousUnixTimeSec with grepable contents: # PreviousUnixTime 1680564200 (2023DApr03 23:23 GMT) # 7. A future version will let the user adjust the time # after start-up using buttons on the WioTerminal. # For now, the user needs to adjust the start-up # time flashed into the file on the Flash Drive. # 8. The RPi Terminal window can be sized to view # the timing of the screen refreshes. Note # the "|" and "_" are there for this purpose. # 9. Will use CCYY MO DD HH:MI SS to conserve LCD space # 10. Defaults to 2023DApr03 if no UnixTime in media/rtc # 11. On a RPi, media/rtc is subfolder of Desktop. #Functions Coded and Used: # beep() # future # createSquareRows() # exists # isDevice() # future # listForSquareDigit()# exists # localDateTime() # exists # setLocalDateTimeCorrectionForCurrentLocalTime() # exists # show() # exists # showList() # exists # strHHMIfromClock() # exists # strip() # exists # waitForInput() # exists # workInProgress() # exists #External Files: media/rtc/previousUnixTimeSec # # WioClock_v02o^^_2023DApr04.py in MicroPython for the WioTerminal # # displays date/time clock # This versioned program is improvised as a function ..._i(): # it is called by an unchanging stub at the end of this code. # This stub can include the versionized name or the Common # Name. *********************************************************** /WioClock.txt