Skip to content

Commit 7797468

Browse files
Comments
1 parent d7e49d0 commit 7797468

File tree

1 file changed

+0
-9
lines changed
  • internal_filesystem/apps/com.micropythonos.showbattery/assets

1 file changed

+0
-9
lines changed

internal_filesystem/apps/com.micropythonos.showbattery/assets/hello.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
"""
2-
8:44 4.15V
3-
8:46 4.13V
4-
5-
import time
6-
v = mpos.battery_voltage.read_battery_voltage()
7-
percent = mpos.battery_voltage.get_battery_percentage()
8-
text = f"{time.localtime()}: {v}V is {percent}%"
9-
text
10-
112
from machine import ADC, Pin # do this inside the try because it will fail on desktop
123
adc = ADC(Pin(13))
134
# Set ADC to 11dB attenuation for 0–3.3V range (common for ESP32)

0 commit comments

Comments
 (0)