Skip to content

Instantly share code, notes, and snippets.

@anecdata
anecdata / scrollMatrixString.ino
Last active March 20, 2021 21:54
Arduino function to scroll a String on an Adafruit 8x16 LED Matrix FeatherWing
// 8x16 LED Matrix I2C FeatherWing
#define MATRIX_ADDR 0x70 // default; 0x71-0x77 with jumper changes
Adafruit_8x16minimatrix matrixDisplay = Adafruit_8x16minimatrix();
setup() {
matrixDisplay.begin(MATRIX_ADDR); // void
}
void scrollMatrixString(String tString, int scrollDelay, int bright, int rot, int tSize, boolean tWrap, int tColor) {
int tLength = tString.length();
@anecdata
anecdata / led_tests.py
Last active March 9, 2019 22:04
Test of built-in red LED and NeoPixel on Feather M4 and PyPortal
import board
import time
from digitalio import DigitalInOut, Direction # , Pull
import neopixel
import random
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
# PyPortal and Feather M4 schematics show built-in NeoPixel is WS2812B
@anecdata
anecdata / esp32spi_localtime_MODIFIED.py
Last active September 9, 2019 14:31
Unique server response headers accumulate across fetches to subsequent URLs
"""
PyPortal CP 4.0.0-beta.3 + adafruit-circuitpython-bundle-4.x-mpy-20190307
Using esp32spi_localtime.py as a base, add in subsequent `wifi.get` calls to other websites.
Note that the original file did not use `reponse.close()`.
Test:
GET server headers from several different websites sequentially; examine server headers.
Between each fetch, call `response.close()` _and_ `response = None`
### Keybase proof
I hereby claim:
* I am anecdata on github.
* I am anecdata (https://keybase.io/anecdata) on keybase.
* I have a public key ASD5V5yuw1bzDAc9GeoYelcE3wiOrKa3f9fbJM_O362I9Qo
To claim this, I am signing this object:
@anecdata
anecdata / ESP32SPI power
Last active January 10, 2021 16:25
ItsyBitsy M4 + ESP32 power configurations
(1) USB power to ItsyBitsy M4 + ESP32 Breakout
typical output:
Retrying ESP32 connection
Error response to command
...
Retrying ESP32 connection
Timed out waiting for SPI char
...
@anecdata
anecdata / esp32spi.txt
Last active March 20, 2021 21:53
TEMPORARY Some raw ESP32SPI test data
re: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/issues/11#issuecomment-483268050
@anecdata
anecdata / code.py
Created April 22, 2019 20:34
displayio memory loss
import board
import os
import gc
import time
import random
import displayio
from adafruit_display_shapes.rect import Rect
def overwrite_bitmap(xw, yh, gmin, gmax):
x = random.randrange(0, xw)
@anecdata
anecdata / code.py
Last active June 3, 2019 16:48
CP 4.0.1 Feather M4 + 2.4" TFT .bmp rough simpletest
import board
import os
import busio
import digitalio
import displayio
import storage
import adafruit_sdcard
import adafruit_ili9341
from adafruit_slideshow import PlayBackOrder, SlideShow, PlayBackDirection
@anecdata
anecdata / ESP32SPI_pins.txt
Last active June 6, 2023 23:04
ESP32SPI Pins
# ESP32_GPIO_PINS:
# https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/master/adafruit_esp32spi/digitalio.py
# 0, 1, 2, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33, 34, 35, 36, 39
#
# Used for ESP32SPI
# 5, 14, 18, 23, 33
# Avialable ESP32SPI Outputs (digital or PWM 'analog') with NINA FW >= 1.3.1
#
# Adafruit ESP32 Breakout
@anecdata
anecdata / code.py
Created June 17, 2019 17:40
3.5" FeatherWing (HX8357) [FeatherM4, 4.1.0-beta.0, Library Bundle 20190615]
"""
This test will initialize the display using displayio
and draw a solid red background
"""
import board
import displayio
import time
print('Begin')