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
// samd21 blink LED on PA10 on Trinket M0 | |
// adapted / stolen from: | |
// https://github.com/LifeWithDavid/RaspberryPiPico-BareMetalAdventures/blob/main/Chapter%2004/assembly.s | |
.cpu cortex-m0 | |
.syntax unified | |
.thumb | |
.global main // used in startup.s | |
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
// originally from: https://github.com/dwelch67/atsamd_samples/tree/master/ATSAMD21/sparkfun/blinker01 | |
#include <stdint.h> // for uint32_t | |
int main(void) { | |
unsigned int ra; | |
unsigned int rx; | |
uint32_t* PORT_A_DIR = (uint32_t*)0x41004400; // "PORT" from Table 12-1 & 23.7 of SAMD21 Datasheet |
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
# rawhid_code.py -- copy to CIRCUITPY as "code.py" | |
# don't forget to install rawhid_boot.py as "boot.py" and press reset | |
# works with report IDs up to 63 byte report count | |
# test with hidapitester like: | |
# ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,3,4,5 --timeout 1000 --read-input 1 | |
# adapted from code presented here: | |
# https://github.com/libusb/hidapi/issues/478 | |
import time | |
import usb_hid |
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
# 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 |
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
# 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 |
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
# 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 |
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
# 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" |
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
""" | |
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 |
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
# audiomixer_demo_i2s.py -- show how to fade up and down playing loops | |
# Code based on that of https://github.com/todbot/circuitpython-tricks/blob/main/larger-tricks/audiomixer_demo.py | |
# where you can also find the WAV files used | |
# 30 Nov 2022 - @todbot / Tod Kurt | |
import time | |
import board | |
import audiocore | |
import audiomixer | |
import audiobusio |
NewerOlder