ESP32 SPI/ESP-NOW working; add watch scripts; sender colors RGB

This commit is contained in:
Pi User
2025-10-01 22:56:24 +13:00
parent 1844a2e4c5
commit f9188b694e
87 changed files with 15115 additions and 15204 deletions

View File

@@ -43,11 +43,11 @@ def quick_spi_test():
print(f"Sent: {[hex(b) for b in hello]} ({''.join([chr(b) for b in hello])})")
print(f"Received: {[hex(b) for b in response]}")
# Test 4: JSON message
print("\nTest 4: JSON message")
payload = {"d":{"t":"b","br":128},"bar":{"pt":"off"}}
json_bytes = list(json.dumps(payload, separators=(",",":"))).encode("utf-8")
response = spi.xfer2(list(json.dumps(payload, separators=(",",":"), ensure_ascii=False).encode("utf-8")))
# Test 4: JSON message (led-bar format)
print("\nTest 4: JSON message (led-bar format)")
payload = {"settings": {"pattern": "off", "brightness": 128}, "save": False}
json_bytes = list(json.dumps(payload, separators=(",", ":"), ensure_ascii=False).encode("utf-8"))
response = spi.xfer2(json_bytes)
print(f"Sent JSON: {json.dumps(payload)}")
print(f"Received: {[hex(b) for b in response]}")