Skip to content

Instantly share code, notes, and snippets.

@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
...
### 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_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`
@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 / 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();