Skip to content

Instantly share code, notes, and snippets.

@elementc
elementc / code.py
Created May 16, 2021 22:22
serial byte read on keybow2040
import math
import board
from keybow2040 import Keybow2040, number_to_xy, hsv_to_rgb
import usb_cdc
# Some constants
FULLBRIGHT = 1
MINBRIGHT = 0.05
# Set up Keybow
@todbot
todbot / random_notes_scale2.py
Last active July 26, 2021 23:32
play random melody in scale, w/ LEDS & LCD accompaniment (CircuitPython on Adafruit FunHouse) video: https://twitter.com/todbot/status/1416139823383941120
# random_notes_scale2.py - play random melody in scale, w/ LEDS & LCD accompaniment
# 16 Jul 2021 - @todbot
import time, random, math
import board, digitalio, pwmio
import adafruit_dotstar # or neopixel
import displayio, terminalio
from adafruit_display_text import label
leds = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, 5, brightness=0.1)
mylabel = label.Label(terminalio.FONT, text="Music???", x=40,y=50, scale=4, color=0xff00ff)
display = board.DISPLAY
@todbot
todbot / staroids_code.py
Last active June 23, 2022 19:53
fakey Almost Asteroids in CircuitPython on FunHouse (ESP32-S2)
# staroids_code.py -- fakey Almost Asteroids
# 4 Aug 2021 - @todbot
# This is just a sketch, the full version of this idea is at https://github.com/todbot/circuitpython_staroids
import board, time, math, random
import displayio, terminalio, bitmaptools
import adafruit_imageload
import bitmaptools
import digitalio
button_L = digitalio.DigitalInOut(board.BUTTON_UP)