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>
This commit is contained in:
43
vendor/ltp305-python/examples/bargraph.py
vendored
Normal file
43
vendor/ltp305-python/examples/bargraph.py
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import time
|
||||
import math
|
||||
import random
|
||||
from ltp305 import LTP305
|
||||
|
||||
|
||||
print("""bargraph.py - A basic graph example
|
||||
|
||||
Displays an animated rising/falling bar on the left matrix,
|
||||
and a scrolling bar graph on the right.
|
||||
|
||||
Press Ctrl+C to exit!
|
||||
|
||||
""")
|
||||
|
||||
display = LTP305()
|
||||
width, height = display.get_shape()
|
||||
|
||||
values = [0, 0, 0, 0, 0]
|
||||
|
||||
|
||||
while True:
|
||||
# Add a new random value to our list and prune the list to visible values
|
||||
values.insert(0, random.randint(0, height))
|
||||
values = values[:width]
|
||||
|
||||
# Animate a value from 0 to height + 1
|
||||
value = (math.sin(time.time() * math.pi) + 1) / 2.0
|
||||
value *= height + 1
|
||||
value = math.floor(value)
|
||||
|
||||
for y in range(height):
|
||||
y = height - 1 - y
|
||||
|
||||
for x in range(width // 2):
|
||||
# Left
|
||||
display.set_pixel(x, y, value <= y)
|
||||
|
||||
# Right
|
||||
display.set_pixel(x + (width // 2), y, values[x] <= y)
|
||||
|
||||
time.sleep(1.0 / height)
|
||||
display.show()
|
||||
Reference in New Issue
Block a user