diff --git a/CircuitPython_Templates/max17048/code.py b/CircuitPython_Templates/max17048/code.py new file mode 100644 index 000000000..41b582fc5 --- /dev/null +++ b/CircuitPython_Templates/max17048/code.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +import time +import board +import adafruit_max1704x + +monitor = adafruit_max1704x.MAX17048(board.I2C()) + +while True: + print(f"Battery voltage: {monitor.cell_voltage:.2f} Volts") + print(f"Battery percentage: {monitor.cell_percent:.1f} %") + print("") + time.sleep(1)