This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import displayio | |
import time | |
from adafruit_featherwing import tft_featherwing_35 | |
from vectorio_helpers import outlined_rectangle | |
# seems to help the touchscreen not get stuck with chip not found | |
time.sleep(3) | |
# display and touchscreen initialization | |
displayio.release_displays() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import supervisor | |
import board | |
import displayio | |
def split_screen(display): | |
# Create a Group | |
mygroup = displayio.Group() | |
# clear the display to the REPL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |