Skip to content

Instantly share code, notes, and snippets.

@hierophect
hierophect / samd_low_power.md
Created July 23, 2021 18:12
SAMD low power notes

SAMD low power notes

Italics: means text taken directly from the datasheet

bold: important module/feature to use

What modules are in use?

  • PM: Power Manager
@hierophect
hierophect / notes.md
Created February 23, 2021 21:08
Notes about I2C failures

Problem: as per #4046, (and maybe #4079), using board.I2C() causes a hard reboot after the first run. It doesn't show an error message or anything.

  • Test sketch:

    import board
    import busio
    i2c = board.I2C()
    #i2c = busio.I2C(board.IO5, board.IO6)

def printdevices():

@hierophect
hierophect / circuitpython2021.MD
Last active January 19, 2021 18:46
Hierophect’s Circuitpython 2021

I’ve been working on Circuitpython for about a year and a half now, contributing to the module code that helps users access chip features. 2020 was tough, but this community has been a refuge against the worst parts of the pandemic, and I feel extremely lucky to have gotten to learn and work on so many different things despite other parts of life being put on hold.

Here’s some of the stuff that happened this year:

  • I spent the early part of 2020 working on support for the STM32 H7 and i.MX chips, and the later half on modules for the ESP32-S2.
  • Some of the stuff I had hoped for got added, like deep sleep/low power features. Other stuff didn’t quite make the cut, like merging in Micropython and adding C module support (hopefully we’ll still get to that eventually).
  • My personal goal to contribute a community library for the Dynamixel servo motor went well!
  • My personal goal to add DMA support did not (I got hopelessly tied up in
@hierophect
hierophect / client.py
Created December 20, 2020 22:27
Client on Host
import socket
HOST = '192.168.10.115' # ESP32S2 IP ADDRESS
PORT = 80 # The port used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
@hierophect
hierophect / code.py
Last active January 9, 2021 18:53
ESP32S2 Server
import wifi
import socketpool
# connect to wifi
wifi.radio.connect("YOURNETWORK", "YOURPASS")
pool = socketpool.SocketPool(wifi.radio)
print(wifi.radio.ipv4_address)
HOST = wifi.radio.ipv4_address
@hierophect
hierophect / code.py
Created September 21, 2020 17:56
SD card test sketch
### SD CARD ----------------
import busio
import sdcardio
import board
import storage
import sys
import os
# Connect to the card and mount the filesystem.
spi = busio.SPI(clock=board.IO5, MOSI=board.IO4, MISO=board.IO3)
@hierophect
hierophect / code.py
Created September 17, 2020 23:54
RGBMatrix Test
import adafruit_display_text.label
import board
import displayio
import framebufferio
import rgbmatrix
import terminalio
import time
displayio.release_displays()
#F4 Version
sphinx-build -b html . _build/html
Running Sphinx v3.2.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 2 changed, 0 removed
reading sources... [100%] index
WARNING: autodoc: failed to import module 'dynamixel'; the following exception was raised:
Traceback (most recent call last):
File "/Users/hierophect/.virtualenvs/default/lib/python3.7/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
@hierophect
hierophect / code.py
Created September 10, 2020 19:56
Testing script
import board
import busio
import displayio
import adafruit_displayio_ssd1306
displayio.release_displays()
print(dir(board))
i2c = busio.I2C(board.IO8, board.IO9)
display_bus = displayio.I2CDisplay(i2c, device_address=0x3c)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)
@hierophect
hierophect / output
Created August 26, 2020 18:26
Default settings of every Circuitpython module
265 Lines Read
FULL BUILDS ------------------------
CIRCUITPY_AUDIOBUSIO
CIRCUITPY_AUDIOIO
CIRCUITPY_BITBANGIO
CIRCUITPY_COUNTIO
CIRCUITPY_DISPLAYIO
CIRCUITPY_FRAMEBUFFERIO