I am using onion omega 2+ and an oled expansion display. I am having trouble displaying battery percentage. I found this site
Onion Omega2: Battery Level and Current date Indicator - Hackster.io
and I followed every step but did not work. Is there someone on the forum that knows how to display battery life and can help please.
Welcome to the forum!!
I’m not familiar with the Onion Omega 2+ myself but might be able to help out if you have access to a REPL, with all of the dependencies installed and running the code:
import os, datetime, time
from OmegaExpansion import oledExp
from subprocess import Popen, PIPE
# find current time
currentTime = datetime.datetime.now()
# measure and format battery voltage
program = Popen("power-dock2", stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = program.communicate()
Then using a REPL to print:
Let us know how you go!