Skip to content

Instantly share code, notes, and snippets.

# convert a .png image file to a .bmp image file using PIL
from PIL import Image
import os
for file in os.listdir("."):
file_in = file
if ".png" in file:
img = Image.open(file_in)
import time
import board
from adafruit_lc709203f import LC709203F
import terminalio
from adafruit_display_text import bitmap_label
from displayio import Group
text_area = bitmap_label.Label(terminalio.FONT, scale=2)
text_area.anchor_point = (0.5, 0.5)
text_area.anchored_position = (board.DISPLAY.width // 2, board.DISPLAY.height // 2)
import board
from displayio import OnDiskBitmap, TileGrid, Group
main_group = Group()
blinka_img = OnDiskBitmap("adafruit_blinka.bmp")
tile_grid = TileGrid(bitmap=blinka_img, pixel_shader=blinka_img.pixel_shader)
main_group.append(tile_grid)
board.DISPLAY.show(main_group)
import supervisor
import board
import displayio
def split_screen(display):
# Create a Group
mygroup = displayio.Group()
# clear the display to the REPL
# SPDX-FileCopyrightText: 2021 jfabernathy for Adafruit Industries
# SPDX-License-Identifier: MIT
# adafruit_requests usage with a CircuitPython socket
# this has been tested with Adafruit Metro ESP32-S2 Express
import ssl
import time
import wifi
# convert a .png image file to a .bmp image file using PIL
from PIL import Image
import os
for file in os.listdir("."):
file_in = file
if ".png" in file:
img = Image.open(file_in)
import json
import supervisor
import time
import board
import neopixel
from digitalio import DigitalInOut, Pull
led = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3, auto_write=True)
led[0] = 0x000000
import serial
import time
send_time = 4 # sec after starting
sent = False
START_TIME = time.monotonic()
with serial.Serial('/dev/ttyACM0', 19200, timeout=1) as ser:
while True:
if not sent:
import supervisor
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
def send_q():
kbd.send(Keycode.Q)
import time
import board
import vectorio
import displayio
from rainbowio import colorwheel
scarf_palette = displayio.Palette(1)
scarf_palette[0] = colorwheel(128)