A thousand and one thank you !
Posts made by favnec5
[UiFlow] real "boot menu : false" mode
Could it be possible that the "boot menu: False" mode in uiFlow settings makes the boot menu hidden and launched faster?
It'is not working (tested on my Core2). It's a shame, it restricts the product for end uses.
RE: Core2 how to know the current battery level
batPercentage = ( batVoltage < 3.2 ) ? 0 : ( batVoltage - 3.2 ) * 100;
micropython welcome :
batPercentage=0 if batVoltage<0 else round((batVoltage-3.2)*100) lcd.print(str(batPercentage)+"%",0,0)
RE: [Core2] Touch event handlers in [MicroPython]?
i use the nice lvgl Lib to do That.
- create personalized button
- add event on the button
from m5stack import * from m5stack_ui import * from uiflow import * import lvgl as lv screen = M5Screen() screen.clean_screen() screen.set_screen_bg_color(0x00000) lv.init() # create screen scr = lv.obj() # set Background screen scr.set_style_local_bg_color(scr.PART.MAIN, lv.STATE.DEFAULT, lv.color_hex(0x000000)) # create button btn = lv.btn(scr) btn.set_size(80, 80) # change style btn.set_style_local_bg_color(scr.PART.MAIN,lv.STATE.DEFAULT, lv.color_hex(0x0000ff)) styleButton = lv.style_t() # create style styleButton.set_bg_color(lv.STATE.DEFAULT, lv.color_hex(0x0000ff)) styleButton.set_radius(lv.STATE.DEFAULT, 0); styleButton.set_border_color(lv.STATE.DEFAULT, lv.color_hex(0x0000ff)) btn.add_style(btn.PART.MAIN,styleButton) #define this style # callback action def action(btn, event): global src if(event == lv.EVENT.CLICKED): btn.set_style_local_bg_color(btn.PART.MAIN, lv.STATE.DEFAULT, lv.color_hex(0xffffff)) btn.set_style_local_border_color(btn.PART.MAIN, lv.STATE.DEFAULT, lv.color_hex(0xffffff)) # define callback btn.set_event_cb(action) # load the screen lv.scr_load(scr)
M5Stack Core2 micropython RTC example
after many tests, I finally understood the curiosity of the RTC of my core2 :
machine.RTC().datetime have not the same params that utime.localtime()
machine.RTC().datetime((2021, 3, 21, 0, 16, 37, 0, 0)) # Y,m,d,0,H,s,i,0 utime.sleep_ms(100) # breathe a little lcd.print(str(machine.RTC().datetime())+"\n") # print Y,m,d,w,H,s,i,timestamp lcd.print(str(utime.localtime())) # print Y,m,d,H,s,i,w,z
It's not the same thing that official micropython documentation,
to set RTC, use particular tuple (year , month, day, week=0, hour, minute, second, timestamp=0)
RE: UIFlow 1.7.3
A kinda related, but strange question - could you please release the source code for the drivers of the various bits of hardware found in the UIFlow firmware? UIFlow is built upon MicroPython, and I would personally prefer to run a clean MicroPython build on a few devices of mine, however the lack of drivers makes it a bit harder than expected. I'm not interested in the UIFlow-related parts, just the low level Core/Unit/Module support drivers (e.g. for M5Paper, a driver for IT8951, a driver for the PMIC, SHT30, GT911). It would allow the community to build MicroPython images without proprietary code, and possibly result in faster updates as well. Plus, you could merge back community fixes into the official UIFlow firmware easily.
Same thing for me.
But I like uiFlow tool to test the code.
For example, Update the UIFlow-code project on git with core2 libs would be cool