import os, sys, io
import M5
from M5 import *
from hardware import sdcard
label0 = None
def setup():
global label0
M5.begin()
Widgets.fillScreen(0x222222)
label0 = Widgets.Label("label0", 21, 46, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
sdcard.SDCard(slot=2, width=1, sck=18, miso=19, mosi=23, cs=4, freq=1000000)
label0.setText(str(os.listdir('/sd/')))
def loop():
global label0
M5.update()
if __name__ == '__main__':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")
Posts made by lbuque
-
RE: SD Card wont init or do anything
-
RE: SDCard not working after UIFlow 1 -> UIFlow 2 upgrade ? (M5Stack Fire)
@rodrigob This issue has been fixed in uiflow 2.1.6.
-
RE: MiniJoyC support in UIFlow2
@Rango 我不明白你为什么需要关注校准值。校准值在出厂的时候已经经行校准,输出的adc值是使用校准值进行计算之后的结果。
-
RE: MiniJoyC support in UIFlow2
I didn't find this problem. It is working properly.
-
RE: MiniJoyC support in UIFlow2
@Rango What problem did you encounter and what did you try?
-
RE: PWRCAN support
@a-ginzbourg CAN is already supported, you can try using CAN.
-
RE: Displaying images from SD on Cardputer causes reboot
@jasdo8120 drawImage currently only supports paths under the littlefs file system and does not support displaying images in SD.
-
RE: Code Generating Bug existing in the "Subscribe" Block of Software MQTT Module
Please use connect instead of reconnect.
-
RE: Download to Atom Matrix
@mattjc I tried the 2.1.4 firmware and did not see this problem. Please provide more detailed information.
-
RE: UiFlow 2.1.3 Web app export to .py for use on CoreS3
This will save a copy of the py file to the apps directory. You can then see it in APP.LIST.
-
RE: Please help with persistent error message. Thanks...
@wmatkins said in Please help with persistent error message. Thanks...:
res/img/UIFScreen2.JPG
Modify the file to res/img/UIFScreen2.jpg
-
RE: UiFlow 2.0 discuss(how-to, bug, feature request or sometings)
@digiponta said in UiFlow 2.0 discuss(how-to, bug, feature request or sometings):
I need it supports M5Stack DIN base with M5 stack/S3.
DIN base does not require software support, it can be used directly.
-
RE: UiFlow 2.0 discuss(how-to, bug, feature request or sometings)
@CAT-the-Tech I tried running your code and found that it works well.