Skip to content

Instantly share code, notes, and snippets.

View todbot's full-sized avatar
💭
doing the blink1

Tod Kurt todbot

💭
doing the blink1
View GitHub Profile
@todbot
todbot / blink_led_samd_assembly.s
Last active April 15, 2024 01:07
samd21 blink LED on PA06 on Trinket M0
@todbot
todbot / blink_led_samd.c
Last active April 13, 2024 20:53
samd21 blink LED in C, no SDK
@todbot
todbot / bitmapfilter_play3_code.py
Created April 3, 2024 15:00
bitmapfilter playing w/ channel ops and blur on random lines in CircuitPython
# bitmapfilter_play3_code.py -- chops + blur on random lines
# 2 Apr 2024 - @todbot / Tod Kurt
import time, math, random
import board
import rainbowio
import vectorio
import displayio
import bitmaptools
import bitmapfilter
import gc
@todbot
todbot / bitmapfilter_play2_code.py
Last active April 2, 2024 00:01
spirograph fun w/ bitmapfilter in CircuitPython
# bitmapfilter_play2_code.py -- spirograph fun w/ bitmapfilter
# 1 Apr 2024 - @todbot / Tod Kurt
import time, math, random
import board
import rainbowio
import vectorio
import displayio
import bitmaptools
import bitmapfilter
@todbot
todbot / wifi_clock_code.py
Last active April 1, 2024 23:17
Make an internet clock with CircuitPython using WorldTimeAPI.org
# Make an internet clock with CircuitPython using WorldTimeAPI.org
# 31 Mar 2024 - @todbot / Tod Kurt
# Use resulting strings for displaying on a display of some kind
import os, time
import wifi
import adafruit_requests
import socketpool
import ssl
time_url = "http://worldtimeapi.org/api/ip"
@todbot
todbot / bitmapfilter_play1_code.py
Last active April 9, 2024 12:03
starting to play with bitmapfilter in CircuitPython for Processing- / p5js-like effects
# starting to play with bitmapfilter
# 31 Mar 2024 - @todbot / Tod Kurt
import time, math, random
import board
import vectorio
import displayio
import bitmaptools
import bitmapfilter
display = board.DISPLAY
@todbot
todbot / lilygo_tdisplay_s3_handsetup.py
Created March 28, 2024 20:18
LilyGo T-Display S3 display hand-setup in CircuitPython
"""
LilyGo T-Display S3 display hand-setup. Not normally required if using https://circuitpython.org/board/lilygo_tdisplay_s3/
"""
import time
import board
import digitalio
import displayio
import paralleldisplaybus
import adafruit_st7789
@todbot
todbot / code_color_palette_finder.py
Last active March 10, 2024 20:50
Color summarizer / color palette finder for CircuitPython
# code.py example for color_palette_finder.py
# 9 Mar 2024 - @todbot / Tod Kurt
# Needs 'color_palette_finder.py' library
# video demo: https://youtu.be/dSR6IVxeaTg
import time
import board
import displayio
import vectorio
import gc
@todbot
todbot / average_jpeg_color_code.py
Last active March 10, 2024 00:05
Compute average color of a JPEG image in CircuitPython
# Compute the average (median or mean) color of a JPEG using ulab.numpy
# 9 Mar 2024 - @todbot / Tod Kurt
# Note: test images are included as comment below, max tested resolution 256x192
import ulab.numpy as np
import displayio
import jpegio
def rgb565_to_rgb888(v, swapped=True):
"""Convert RGB565 (normal or swapped) to RGB888 tuple"""
if swapped:
@todbot
todbot / WiFiWebClient_todbot.ino
Created February 26, 2024 18:43
Arduino WiFiWebClient, verified to work on PicoW with arduino-pico core
// from:
// https://docs.arduino.cc/retired/library-examples/wifi-library/WiFiWebClient/
#include <WiFi.h>
// Enter your WiFi SSID and password
char ssid[] = "todbot"; // your network SSID (name)
char pass[] = "testtesttest"; // your network password (use for WPA, or use as key for WEP)
char server[] = "wifitest.adafruit.com"; // host name address for adafruit test