コード例 #1
0
from adafruit_display_text import label
from adafruit_ssd1331 import SSD1331

# Release any resources currently in use for the displays
displayio.release_displays()

spi = board.SPI()
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(spi,
                                 command=tft_dc,
                                 chip_select=tft_cs,
                                 reset=board.D9)

display = SSD1331(display_bus, width=96, height=64)

# Make the display context
splash = displayio.Group(max_size=10)
display.show(splash)

color_bitmap = displayio.Bitmap(96, 64, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00  # Bright Green

bg_sprite = displayio.TileGrid(color_bitmap,
                               pixel_shader=color_palette,
                               x=0,
                               y=0)
splash.append(bg_sprite)
コード例 #2
0
ファイル: code.py プロジェクト: JSCProps/MandoPuter
                                     command=tft_dc,
                                     chip_select=tft_cs,
                                     reset=lcd_rst)
    display = ST7735R(display_bus,
                      rotation=TEXT_ROTATION,
                      width=160,
                      height=80,
                      colstart=24,
                      bgr=True)
    font = bitmap_font.load_font("mandalor80.bdf")  # 80 pixel tall bitmap font
elif DISPLAY == "0.96 OLED":
    display_bus = displayio.FourWire(spi,
                                     command=tft_dc,
                                     chip_select=tft_cs,
                                     reset=lcd_rst)
    display = SSD1331(display_bus, rotation=TEXT_ROTATION, width=96, height=64)
    font = bitmap_font.load_font("mandalor64.bdf")  # 64 pixel tall bitmap font
elif DISPLAY == "0.96 Mono OLED":
    TEXT_COLOR = 0xFFFFFF  # it's monochrome, you can only do white
    display_bus = displayio.FourWire(spi,
                                     command=tft_dc,
                                     chip_select=tft_cs,
                                     reset=lcd_rst,
                                     baudrate=1000000)
    display = SSD1306(display_bus,
                      rotation=TEXT_ROTATION,
                      width=128,
                      height=64)
    font = bitmap_font.load_font("mandalor64.bdf")  # 64 pixel tall bitmap font
elif DISPLAY == "1.14 LCD":
    display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)