Skip to content

Instantly share code, notes, and snippets.

Avatar

Lucian Copeland hierophect

View GitHub Profile
View samd_low_power.md

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 Feb 23, 2021
Notes about I2C failures
View notes.md

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 Jan 19, 2021
Hierophect’s Circuitpython 2021
View circuitpython2021.MD

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
View client.py
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 Jan 9, 2021
ESP32S2 Server
View code.py
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 Sep 21, 2020
SD card test sketch
View code.py
### 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 Sep 17, 2020
RGBMatrix Test
View code.py
import adafruit_display_text.label
import board
import displayio
import framebufferio
import rgbmatrix
import terminalio
import time
displayio.release_displays()
#F4 Version
View gist:7df2c48dd49b691ca0cbd480c02d1cff
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 Sep 10, 2020
Testing script
View code.py
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 Aug 26, 2020
Default settings of every Circuitpython module
View output
265 Lines Read
FULL BUILDS ------------------------
CIRCUITPY_AUDIOBUSIO
CIRCUITPY_AUDIOIO
CIRCUITPY_BITBANGIO
CIRCUITPY_COUNTIO
CIRCUITPY_DISPLAYIO
CIRCUITPY_FRAMEBUFFERIO