Last active
October 12, 2017 22:18
-
-
Save jon1012/ae66170d0449c45d48f88609f448a0f2 to your computer and use it in GitHub Desktop.
just a test to display a clock on m5stack using loboris esp32 stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import machine, time | |
tft.init(tft.ILI9341, width=320, height=320, miso=19, mosi=23, clk=18, cs=14, dc=27, bgr=True, backl_pin=32, rst_pin=33, backl_on=1, spihost=tft.VSPI, invrot=2) | |
tft.orient(2) | |
tft.font(tft.FONT_7seg, color=tft.WHITE) | |
while True: | |
now = machine.RTC().now() | |
txt = "%02d:%02d:%02d" % now[3:6] | |
tft.textClear(tft.RIGHT,200,txt) | |
tft.text(tft.RIGHT,200,txt) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment