This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
import displayio | |
from vectorio import Rectangle, Circle, Polygon, VectorShape | |
import time | |
import random | |
import gc | |
# Make the display context | |
SPLASHMAX = 2000 | |
splash = displayio.Group(max_size=SPLASHMAX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variation on https://github.com/gmeader/pyportal/blob/master/bug_demo.py | |
import adafruit_sdcard | |
import busio | |
import digitalio | |
import board | |
import storage | |
import os | |
# Connect to the card and mount the filesystem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import adafruit_lps35hw | |
import adafruit_dps310 | |
import adafruit_shtc3 | |
""" | |
run, then ^C^D or re-save file to CIRCUITPY, | |
and line 42 (`sht =`) will fail: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ESP32S2 pins: | |
# strapping pins* | |
# | |
# 0* wpu | |
# 2 amber LED on Cucumber | |
# 8 antitipated I2C SDA on production UMFeatherS2 | |
# 9 antitipated I2C SCL on production UMFeatherS2 | |
# 13 blue LED on UMFeatherS2 | |
# 14 LED on Bast | |
# 15 I2C SDA on Bast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 'ESP32S2' in os.uname().machine: | |
print("MAC", ":".join('%x' % x for x in wifi.radio.mac_address)) | |
# don't proceed w/o any Wi-Fi APs | |
print("Scanning WiFi...") | |
while True: | |
try: | |
for network in wifi.radio.start_scanning_networks(): | |
print("{0:02X}:{1:02X}:{2:02X}:{3:02X}:{4:02X}:{5:02X}".format(*network.bssid), | |
network.channel, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wifi | |
import socketpool | |
import struct | |
import time | |
import sys | |
from secrets import secrets | |
NTP_TO_UNIX_EPOCH = 2208988800 # 1970-01-01 00:00:00 | |
packet = bytearray(48) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server code: | |
# https://github.com/adafruit/circuitpython/blob/main/tests/circuitpython-manual/socketpool/client/host-server.py | |
import board | |
from digitalio import DigitalInOut | |
from adafruit_esp32spi import adafruit_esp32spi | |
import adafruit_esp32spi.adafruit_esp32spi_socket as socket | |
import adafruit_requests as requests | |
from secrets import secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
re: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/issues/11#issuecomment-483268050 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |