File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
internal_filesystem/apps/com.micropythonos.showbattery Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 33"publisher" : " MicroPythonOS" ,
44"short_description" : " Minimal app" ,
55"long_description" : " Demonstrates the simplest app." ,
6- "icon_url" : " https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.0.3_64x64 .png" ,
7- "download_url" : " https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.0.3 .mpk" ,
6+ "icon_url" : " https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.1.0_64x64 .png" ,
7+ "download_url" : " https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.1.0 .mpk" ,
88"fullname" : " com.micropythonos.showbattery" ,
9- "version" : " 0.0.3 " ,
9+ "version" : " 0.1.0 " ,
1010"category" : " development" ,
1111"activities" : [
1212 {
13- "entrypoint" : " assets/hello .py" ,
14- "classname" : " Hello " ,
13+ "entrypoint" : " assets/show_battery .py" ,
14+ "classname" : " ShowBattery " ,
1515 "intent_filters" : [
1616 {
1717 "action" : " main" ,
Original file line number Diff line number Diff line change 4040import lvgl as lv
4141import time
4242
43- from mpos import BatteryManager , Activity
43+ from mpos import Activity , BatteryManager
4444
45- class Hello (Activity ):
45+ class ShowBattery (Activity ):
4646
4747 refresh_timer = None
4848
@@ -60,14 +60,12 @@ def onResume(self, screen):
6060 super ().onResume (screen )
6161
6262 def update_bat (timer ):
63- #global l
6463 r = BatteryManager .read_raw_adc ()
6564 v = BatteryManager .read_battery_voltage ()
6665 percent = BatteryManager .get_battery_percentage ()
6766 text = f"{ time .localtime ()} \n { r } \n { v } V\n { percent } %"
68- #text = f"{time.localtime()}: {r}"
6967 print (text )
70- self .update_ui_threadsafe_if_foreground ( self . raw_label .set_text , text )
68+ self .raw_label .set_text ( text )
7169
7270 self .refresh_timer = lv .timer_create (update_bat ,1000 ,None ) #.set_repeat_count(10)
7371
You can’t perform that action at this time.
0 commit comments