mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00

display check with 2.9.2 -gfxhat sn3218 library missing from the venv, added to /hw/libs/pimoroni/gfxhat/ cleanup of the code (EPD changed to LCD) logging info added for config options (contrast, color) touch control work in progress (6 touch buttons with short and long press and LED feedback) -i2coled cleanup of the code (EPD changed to OLED) Logging info added for config options (width, height, i2c address) -oledlcd and oledlcdvert working out of the box logging info added for available gpio breakouts (buttons) -displayhatmini working out of the box logging info added for available gpio breakouts (buttons, rgb LED, i2c bus) -pirateaudio working out of the box logging info added for available gpio breakouts (buttons, i2s bus) -pitft working out of the box logging info added for available gpio breakouts (buttons) -tftbonnet working out of the box logging info added for available gpio breakouts (buttons, i2c bus) -minipitft working out of the box logging info added for available gpio breakouts (buttons, i2c bus) -minipitft2 cant test on HW but should work! logging info added for available gpio breakouts (buttons, i2c bus) -argonpod cant test on HW but should work! logging info added for available gpio breakouts (buttons, IR)
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
from . import SSD1306
|
|
|
|
# Display resolution, change if the screen resolution is changed!
|
|
EPD_WIDTH = 128
|
|
EPD_HEIGHT = 64
|
|
|
|
# Available screen resolutions:
|
|
# disp = SSD1306.SSD1306_128_32(128, 32, address=0x3C)
|
|
# disp = SSD1306.SSD1306_96_16(96, 16, address=0x3C)
|
|
# If you change for different resolution, you have to modify the layout in pwnagotchi/ui/hw/i2coled.py
|
|
|
|
class OLED(object):
|
|
|
|
def __init__(self, address=0x3C, width=EPD_WIDTH, height=EPD_HEIGHT):
|
|
self.width = width
|
|
self.height = height
|
|
|
|
# choose subclass based on dimensions
|
|
if height == 32:
|
|
self.disp = SSD1306.SSD1306_128_32(width, height, address)
|
|
elif height == 16:
|
|
self.disp = SSD1306.SSD1306_96_16(width, height, address)
|
|
else:
|
|
self.disp = SSD1306.SSD1306_128_64(width, height, address)
|
|
|
|
def Init(self):
|
|
self.disp.begin()
|
|
|
|
def Clear(self):
|
|
self.disp.clear()
|
|
|
|
def display(self, image):
|
|
self.disp.getbuffer(image)
|
|
self.disp.ShowImage() |