Utilities for working with the M5Stack Core in Micropython.
In the src/terminal directory, you find a module terminal.py usefull for
logging data to the m5stack Core 320x240 screen. It is far from beeing
performant but it does the job.
The terminal displays 15 lines of text. Contrary to the lcd.print(message)
method, the Terminal.print(message) method behaves like a real terminal : once
all the lines have been filled, all the lines of text are shifted, the first
line disapears and the last printed data line is displayed on the bottom line.
The first way to use the Terminal class is to simply copy it in your program into UIFlow.
-
Copy the content of the
terminal.pyfile in UIFlow -
Create an instance of the
Terminalclass... t = Terminal() t.print('temperature log')
There is also the possibility to import the Terminal class from a separated
module.
-
Copy the file
terminal.pyonto the M5Stack with UIFlow using the file manager (add file tool). Create a fileterminal.pyin theappsfolder of the M5Stack and copy the contents of theterminal.pyfile and save (Ctrl + S) in the browser. -
Use an
importstatetement in your programfrom terminal import Terminal t = Terminal() ...
You can find an example using the Terminal class to log data read from the ENV unit in the src/terminal/env_sensor_log.py file.