ESP32 SPI/ESP-NOW working; add watch scripts; sender colors RGB
This commit is contained in:
@@ -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]}")
|
||||
|
||||
|
Reference in New Issue
Block a user