Inkplate 5v2 MicroPython - Battery and temperature
Inkplate 5v2 includes built-in functions for measuring battery voltage and board temperature. This example shows how to read these values and display them on screen.
⚠️
You need a Li-ion battery for this example to work, to learn more, check out battery docs page.
Battery should be connected like this:

Battery connected to Inkplate 5v2.
Reading battery voltage and temperature
from inkplate5v2 import Inkplate
import time
inkplate = Inkplate(Inkplate.INKPLATE_1BIT)
inkplate.begin()
inkplate.clearDisplay()
inkplate.display()
# Get battery voltage as a string
battery = str(inkplate.readBattery())
inkplate.setTextSize(2)
inkplate.printText(350, 350, "Battery voltage: " + battery + "V")
inkplate.partialUpdate()
# Get temperature reading as a string
temperature = str(inkplate.readTemperature())
inkplate.printText(350, 400, "Temperature: " + temperature + "C")
inkplate.partialUpdate()
inkplate.readBattery()
Measure the current battery voltage of the Inkplate board.
Returns type: float
Returns value: Battery voltage in volts.
inkplate.readTemperature()
Measure the temperature of the Inkplate board’s internal sensor.
Returns type: float
Returns value: Temperature in degrees Celsius.

Displaying battery and temperature data on Inkplate display.