Skip to content

Instantly share code, notes, and snippets.

@stonehippo
stonehippo / wio-terminal-circuitpython.md
Last active February 13, 2024 13:32
Using CircuitPython modules to work with the Seeed Wio Terminal

Seeed Wio Terminal Circuitpython Modules

note: All of these examples have been tested with the latest version of CircuitPython, which as of this writing was 7.2.4. Some of these examples may require tweaks in older or later versions, due to change in the drivers.

The Seeed Wio Terminal is a nifty connected device development kit. Built around a SAMD51 Cortex-M4 microcontroller and a Realtek RTL8720DN for WiFi and Bluetooth, plus an integrated display and a collection of handy sensors, the Wio Terminal is a great platform for IoT and smart device development.

One of the nice things about the Wio Terminal is the number of options available for developement platforms. You can choose the long-time hardware hacking favorite Arudino, MicroPython or Ardupy, an interesting blend of MicroPython and Arduino. And there's support for my

@stonehippo
stonehippo / arduino-cli_aliases.zsh
Created January 21, 2022 13:04
Arduino CLI shorthand aliases
# Arduino CLI shortcuts
# Compile and upload; add the USB port to the end or it will error
# Arduino Uno
alias ac-uno="arduino-cli compile -b arduino:avr:uno -u -p"
# Arduino Pro or Pro Mini, at 3.3v/8MHz or 5v/16Mhz
alias ac-pro-8mhz="arduino-cli compile -b arduino:avr:pro:cpu=8MHzatmega328 -u -p"
alias ac-pro-16mhz="arduino-cli compile -b arduino:avr:pro -u -p"
@stonehippo
stonehippo / README.md
Last active January 17, 2022 01:52
Fixing CircuitPython Blinka displayio to work with the MCP2221A

Fixing CircuitPython Blinka displayio to work with the MCP2221A

Dependencies

  • Adafruit CircuitPython Blinka, configured to work with the MCP2221A breakout
  • Adafruit CircuitPython Blinka DisplayIO
  • Adafruit CircuitPython Display Text
  • Adafruit CircuitPython Bitmap Font

Issues to address

@stonehippo
stonehippo / README.md
Last active October 27, 2022 21:22
Zsh aliases for managing Ardupy

Zsh aliases for Ardupy

Zsh aliases for an installation of Ardupy using a Python virtualenv set up using pyenv.

It looks like Seeed has suspended development of Ardupy. It's been a while since anything was contributed, and they've archived the public repos.

Aliases

Alias Command Notes
@stonehippo
stonehippo / README.md
Created January 16, 2022 23:12
Zsh aliases for managing Ampy

Zsh aliases for ampy

Zsh aliases for an installation of ampy using a Python virtualenv set up using pyenv.

Aliases

Alias Command Notes
ampy_enable enable ampy virtualenv
ampy_disable disable ampy virtualenv
@stonehippo
stonehippo / README.md
Last active January 16, 2022 23:12
Zsh aliases for managing access with the Adafruit MCP2221A breakout

Zsh aliases for Adafruit MCP2221A breakout

The AdafruitMCP2221A breakout is a handy little board for adding peripherals to a computer via USB. It provides UART, similar to a standard USB to serial interface, and adds GPIO, ADC, DAC, and I2C. This means you can use your computer to directly read sensors or control devices directly, without using a microcontroller.

Adafruit has added support for the MCP2221A to the CPython port of CircuitPython (Blinka). This means that you get a nice Python interface to work with all sorts of fun stuff.

The aliases in this gist reflect some settings that are needed in my MacOS setup to work with the MCP2221A breakout. I am using the now-default zsh, supplemented by the excellent Oh My Zsh, so I put this file in OMZ's custom location, $ZSH_CUSTOM.

For more information on the breakout, and getting it set up with Windows, MacOS, and Linux, check out

@stonehippo
stonehippo / minute_timer.ino
Created November 23, 2021 13:20
A trivial Arduino application showing delaying an event synchronously for some number of minutes
#define SECOND 1000 // 1 sec = 1000 millseconds
#define MINUTE 60 * SECOND // 60 sec = 1 minute
void setup() {
Serial.begin(115200);
randomSeed(analogRead(0)); // choose a pseudo-random starting seed
}
void loop() {
WaitForNMinutes();
@stonehippo
stonehippo / gourd.ino
Created October 29, 2021 21:28
Carved gourd/pumpkin flicker with an Arduino and NeoPixels.
// A simple pumpkin/gourd flicker light
// Written by 2021 George White (stonehippo@gmail.com)
// This code is in the public domain
//
// I built this to power a little carved gourd for a company function.
// I ran it on an Adafruit Trinket 3.3V with two NeoPixels dots, but it
// should work on pretty much any Arduino-compatible board. The main
// thing you'd have to change it the PIXEL_PIN.
#define PIXEL_PIN 0
@stonehippo
stonehippo / hardware_cli_tools.md
Created August 15, 2021 01:47
Some hardware hacking tools I use

Tools for hardware - in case you forget

ESP8266 & NodeMCU

  • esptool.py (for flash ESP8266s)
  • nodemcu-tool (for file management

micropython

  • esptool.py (for flashing ESP8266s)