Files
drunkendotfiles/vendor/breakout-garden/examples/spirit-level
dissimulo 030172f523 Initial backup of LTP-305G matrix clock setup on matrixpi
Captures everything needed to redeploy the two-display clock (hour on I2C
0x61, minute on I2C 0x63) on a fresh Pi:

- Both systemd units (matrix0x61.service, matrix0x63.service)
- Deployed Pimoroni script tree, including the local %I (12-hour) clock
  customization
- Vendored upstream sources (ltp305-python, breakout-garden) so restore is
  fully offline-capable
- Boot config snippet enabling I2C
- install.sh that wires it all back up idempotently
- Inventory doc cross-referencing every live-system path

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 01:32:39 -07:00
..

Spirit level example

This examples emulates a circular spirit level, using the LCD to draw the spirit level and the 3DoF motion sensor to detect orientation.

Pre-requisites

This example requires:

Installation

Pop the breakouts into your Breakout Garden, and then run the install.sh script in the root of this repository with sudo ./install.sh to automagically install the libraries to run the I2C breakouts.

For this example you'll need to make sure some additional software is installed:

sudo apt install python3-pil

You'll need to clone and install the library for the 1.3" LCD Breakout as follows:

git clone https://github.com/pimoroni/st7789-python
cd library
sudo python3 setup.py install

This example assumes that you have the LCD plugged into the front slot on the Breakout Garden HAT, which should also work with the Breakout Garden Mini HAT. To change it to the back slot, change cs=ST7789.BG_SPI_CS_FRONT to cs=ST7789.BG_SPI_CS_BACK and backlight=19 to backlight=18` on the line where the LCD is set up.

Running this example

To run this example, type ./spirit-level.py in the terminal.

It's assumed that you have the MSA301 breakout and LCD breakout lying flat, so your Raspberry Pi or Raspberry Pi Zero will be perpendicular to your flat surface.