Skip to content

Instantly share code, notes, and snippets.

@dglaude
dglaude / All keycode sorted (by column 2)
Last active March 16, 2024 19:51
Keyboard mapping CardPuter Card Computer
K.APPLICATION
K.Z
K.C
K.B
K.M
K.DOWN_ARROW
K.SPACEBAR
K.CAPS_LOCK
K.S
K.F
@dglaude
dglaude / code.py
Last active December 22, 2023 06:05
Playing an wav audio file on button press with "Feather RP2040 Prop-Maker" (update Debounce)
import supervisor
supervisor.set_next_code_file(None, reload_on_error=True)
import board
import audiocore
import audiobusio
import audiomixer
from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer
@dglaude
dglaude / Ruxpin_wakeup.py
Created October 31, 2023 21:55
Halloween Teddy Ruxpin: Monitor time of fly distance and power off USB-A port for 5 minutes when there is activity.
# SPDX-FileCopyrightText: 2022 David Glaude (based on 2021 ladyada for Adafruit Industries)
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Carter Nelson for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
# Simple demo of the VL53L1X distance sensor.
# Will print the sensed range/distance every second.
@dglaude
dglaude / code.py
Created August 22, 2023 22:01
My Pico DV Base 3 buttons drums
"""Three button drum machine on Pico DV base"""
import time
import board
from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer
import synthio
import audiobusio
import audiomixer
@dglaude
dglaude / code.py
Created March 19, 2023 13:41
S2 PICO V1.0.0 WEMOS.CC testing: board.DISPLAY
# Import all board pins.
import board
import busio
import time
import displayio
import adafruit_displayio_ssd1306
import vectorio
displayio.release_displays()
@dglaude
dglaude / boot.py
Created February 8, 2023 20:53
Mouse jiggler with speed control of the rotation, and only visible as mouse if boot.py is selected.
import storage, usb_cdc
import board, digitalio
import usb_hid, usb_midi
# On the Macropad, pressing a key grounds it. You need to set a pull-up.
# If not pressed, the key will be at +V (due to the pull-up).
button = digitalio.DigitalInOut(board.KEY12)
button.pull = digitalio.Pull.UP
# Disable devices only if button is not pressed.
@dglaude
dglaude / code.py
Created October 18, 2022 22:03
Seeeduino XIAO RP2040: Build in RGB LED simultaniously as NeoPixel.
"""Seeeduino XIAO RP2040: Build in RGB LED simultaniously as NeoPixel."""
import time
import board
import neopixel
import digitalio
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
@dglaude
dglaude / code.py
Created September 27, 2022 21:25
PASsive aggRESiVE writING with CirCUITPYthon (i diD IT oN A QT pY M0)
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import time
import random
# Initialize Keyboard
kbd = Keyboard(usb_hid.devices)
# Press and release CapsLock in loop.
@dglaude
dglaude / notes.md
Last active November 15, 2023 09:32
WebHID research notes
@dglaude
dglaude / camera.md
Created September 26, 2022 17:43
Should we have camera as a feature in CircuitPython download and what board?