Skip to content

Instantly share code, notes, and snippets.

@dglaude
dglaude / adafruit_st25dv16.py
Created Dec 20, 2021
Writing URI into st25dv16 from CircuitPython
View adafruit_st25dv16.py
# SPDX-FileCopyrightText: Copyright (c) 2021 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_st25dv16`
================================================================================
CircuitPython driver for the I2C EEPROM of the Adafruit ST25DV16 Breakout
@dglaude
dglaude / code.py
Created Dec 1, 2021
Belgian vaccination status for MagTag
View code.py
from adafruit_magtag.magtag import MagTag
from adafruit_progressbar.progressbar import ProgressBar
# BELGIUM
POPULATION = 11589616
DATA_SOURCE = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/country_data/Belgium.csv"
magtag = MagTag(url=DATA_SOURCE)
magtag.network.connect()
@dglaude
dglaude / super_multi.py
Created Sep 8, 2021
Multiple Buzz! controler on one Raspberry Pi.
View super_multi.py
"""
Turn on all the LEDs from each Buzz! controler one after the other.
Work with both kind of wired Buzz! controler.
Require to install hid library, not an easy task.
"""
import hid
import time
@dglaude
dglaude / simple_test.py
Created Jul 24, 2021
keypad simple test by @FoamyGuy found on adafruit Discord 23/07/2021
View simple_test.py
from keypad import Keys
import board
import time
pins = [board.BUTTON_A, board.BUTTON_B]
keys = Keys(pins, value_when_pressed=False, pull=True)
while True:
if keys.events.overflowed:
keys.events.clear()
@dglaude
dglaude / emojiclock
Created Jun 14, 2021
Tentative dynamic emoji in Discord (edit previous post and change by a different emoji every second)
View emojiclock
# CircuitPython Discord rotating clock emoji (spam).
# Type an emoji in Discord... do nothing else, with your ItsiBitsy nrF.
# Press the button to replace that emoji by another one every second.
import time
import board
import usb_hid
from digitalio import DigitalInOut, Direction
from adafruit_hid.keyboard import Keyboard
@dglaude
dglaude / Dual_mouse_bug.py
Created Jun 14, 2021
Code.py found on "Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit ItsyBitsy nRF52840 Express with nRF52840" date 2020/04/14
View Dual_mouse_bug.py
###
# Dual BLE mouse jiggling:
# Advertise a first mouse as "CircuitPython HID1"
# Once we have a first connection
# Advertise a second mouse as "CircuitPython HID2"
#
# Once the first mouse is connected the jiggling start.
# Mouse1 should do Left-Right movement
# Mouse2 (once connected) should do Up-Down movement
#
@dglaude
dglaude / code.py
Created May 16, 2021
Hidden Mouse Jiggler
View code.py
import time
import board
import digitalio
import storage
import usb_hid
from adafruit_hid.mouse import Mouse
import usb_cdc
#usb_hid.enable(devices=(usb_hid.MOUSE,)) ###AttributeError: 'module' object has no attribute 'MOUSE'
@dglaude
dglaude / code.py
Created May 10, 2021
Thermal camera mono-source multiple platform
View code.py
### Thermal camera mono-source multiple platform:
###
### On a FeatherWing Keyboard:
### 'FeatherS2 with ESP32S2'
### 'Adafruit Feather RP2040 with rp2040'
###
### With build in screen:
### 'Adafruit CLUE nRF52840 Express with nRF52840'
### 'Adafruit Matrix Portal M4 with samd51j19' + 32x64 Matrix
### If a 64x64 matrix (or two time 32x64) then the following
@dglaude
dglaude / code.py
Last active May 10, 2021
MLX90640 + FeatherWing Keyboard bilinear upscalling and displayio pixel stretching with Feather RP2040 and Feather S2
View code.py
### MLX90640 + FeatherWing Keyboard bilinear upscalling and displayio pixel stretching
### Feather RP2040: Reach 4x bilinear x2 pixel doubling
### Feather S2: Reach x5 bilinear x2 pixel doubling
### Detect what Feather is in use and adapt
# Input is 32x24
# Make use of ulab for fast math operation on matrix
# Split ulab operations to minimise memory consumption by temporary variable
#from bbq10keyboard import BBQ10Keyboard, STATE_PRESS, STATE_RELEASE, STATE_LONG_PRESS
@dglaude
dglaude / scale_x5_x2.py
Last active May 10, 2021
WIP: Thermal Camera++ FeatherS2 + FeatherWing Keyboard + MLX90640 + ulab x5 bilinear scaling + x2 displayio scaling
View scale_x5_x2.py
from bbq10keyboard import BBQ10Keyboard, STATE_PRESS, STATE_RELEASE, STATE_LONG_PRESS
from adafruit_stmpe610 import Adafruit_STMPE610_SPI
import adafruit_ili9341
import adafruit_sdcard
import digitalio
import displayio
import neopixel
import storage
import board
import time