This file contains hidden or 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 os | |
import time | |
import board | |
import terminalio | |
import displayio | |
from adafruit_display_text.label import Label | |
from adafruit_ssd1675 import SSD1675 | |
from adafruit_il0373 import IL0373 | |
This file contains hidden or 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 time | |
from digitalio import DigitalInOut | |
from adafruit_esp32spi import adafruit_esp32spi | |
from secrets import secrets | |
# AP connect helper | |
def esp_connect(): | |
esp_status = 255 | |
try: |
This file contains hidden or 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 | |
from digitalio import DigitalInOut | |
from adafruit_esp32spi import adafruit_esp32spi | |
def esp_reset(): | |
try: | |
esp.reset() | |
print('ESP Reset') | |
except RuntimeError as e: |
This file contains hidden or 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 busio | |
import digitalio | |
import adafruit_requests as requests | |
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K | |
import adafruit_wiznet5k.adafruit_wiznet5k_socket as wiznet5k_socket | |
from adafruit_esp32spi import adafruit_esp32spi | |
import adafruit_esp32spi.adafruit_esp32spi_socket as esp_socket | |
from secrets import secrets |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
# SPDX-FileCopyrightText: 2020 anecdata | |
# | |
# SPDX-License-Identifier: MIT | |
import microcontroller | |
import board | |
for pin in dir(microcontroller.pin): | |
if isinstance(getattr(microcontroller.pin, pin), microcontroller.Pin): | |
print("".join(("microcontroller.pin.", pin, "\t")), end=" ") |
This file contains hidden or 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
void customWiFiConnect(ssid, pass) { | |
int WiFiStatusNum; | |
unsigned long start; | |
WiFiStatusNum = getWiFiStatus(); | |
if ( WiFiStatusNum != WL_CONNECTED ) { | |
Serial.println("Restarting WiFi..."); | |
WiFi.begin(ssid, pass); | |
start = millis(); | |
while ( WiFiStatusNum != WL_CONNECTED ) { |