Skip to content

Instantly share code, notes, and snippets.

View DJDevon3's full-sized avatar

DJDevon3 DJDevon3

View GitHub Profile
@todbot
todbot / lilygo_esp32s2_imagedisplay.py
Last active July 14, 2022 20:43
Demonstrate external SD card in CircuitPython (on LILYGO ESP32-S2 board https://circuitpython.org/board/lilygo_ttgo_t8_s2_st7789/ )
# lilygo_esp32s2_imagedisplay.py
# 25 Jul 2021 - todbot / Tod Kurt
# SD card handling from:
# https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/circuitpython
import busio
import sdcardio
import storage
import os
sd_spi = busio.SPI(clock=board.SD_CLK, MOSI=board.SD_MOSI, MISO=board.SD_MISO)
@todbot
todbot / eyeballs_dual_gc9a01.py
Last active September 3, 2024 19:15
dual display GC9A01 round TFT LCDs with creepy eyeball animation in CircuitPython
# eyeballs_dual_gc9a01.py - dual display GC9A01 round TFT LCDs with creepy eyeball animation
# 17 May 2022 - @todbot / Tod Kurt
#
# requires recompiled CircuitPython with "#define CIRCUITPY_DISPLAY_LIMIT (2)" in "mpconfigboard.h"
#
import time, math, random
import board, busio
import displayio, terminalio
import gc9a01
@todbot
todbot / fireworks_sprites.py
Last active May 15, 2024 00:05
Fireworks display using sprites in CircuitPython
# fireworks_sprites.py - show a bunch of fireworks
# 4 Jul 2022 - @todbot / Tod Kurt
import time, random
import board
import displayio
import rainbowio
import adafruit_imageload
fireworks_count = 5
sprite_fname = "fireworks_spritesheet.bmp"
@anecdata
anecdata / safemode.py
Last active May 29, 2024 08:30
CircuitPython 8 safemode.py
# SPDX-FileCopyrightText: 2023 anecdata
#
# SPDX-License-Identifier: MIT
import json
import microcontroller
import supervisor
from ⚙️ import *
@todbot
todbot / spinny_radar_box_code.py
Last active February 1, 2024 21:57
spinning sorta radar based off of John Park's CircuitPython Parsec 1 Feb 2024
import board
import displayio
import math
import time
# Set up the display
display = board.DISPLAY
# Create a blank displayio group
tilegroup = displayio.Group()