matekasse_NFC-Reader/oled.py
2024-04-12 21:45:14 +02:00

20 lines
511 B
Python

from board import SCL, SDA
import busio
import adafruit_ssd1306
i2c = busio.I2C(SCL, SDA)
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
def clear():
display.fill(0)
display.show()
def Balance(user_id, user_name, balance):
clear()
display.text(str(user_id), 0, 0, (255,255,255), size=1)
display.text(str(user_name), 50, 0, (255,255,255), size=1)
display.text(str(balance), 0, 50, (255,255,255), size=2)
display.show()
if __name__ == "__main__":
Balance(1, "Test", 255)