|
|
@ -10,11 +10,14 @@ if False: |
|
|
|
s = client.ini_read() |
|
|
|
s = client.ini_read() |
|
|
|
client.ini_write(s) |
|
|
|
client.ini_write(s) |
|
|
|
|
|
|
|
|
|
|
|
if False: |
|
|
|
if True: |
|
|
|
buf = client.bulk_read(gex.MSG_INI_READ) |
|
|
|
buf = client.bulk_read(gex.MSG_INI_READ) |
|
|
|
print(buf.decode('utf-8')) |
|
|
|
print(buf.decode('utf-8')) |
|
|
|
|
|
|
|
|
|
|
|
client.bulk_write(gex.MSG_INI_WRITE, buf) |
|
|
|
pb = gex.PayloadBuilder() |
|
|
|
|
|
|
|
pb.u32(len(buf)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
client.bulk_write(gex.MSG_INI_WRITE, pld=pb.close(), bulk=buf) |
|
|
|
|
|
|
|
|
|
|
|
if False: |
|
|
|
if False: |
|
|
|
leds = gex.DOut(client, 'strip') |
|
|
|
leds = gex.DOut(client, 'strip') |
|
|
@ -52,7 +55,7 @@ if False: |
|
|
|
strip.write((b << 2) | ((~b) & 1)) |
|
|
|
strip.write((b << 2) | ((~b) & 1)) |
|
|
|
time.sleep(.02) |
|
|
|
time.sleep(.02) |
|
|
|
|
|
|
|
|
|
|
|
if False: |
|
|
|
if True: |
|
|
|
neo = gex.Neopixel(client, 'npx') |
|
|
|
neo = gex.Neopixel(client, 'npx') |
|
|
|
|
|
|
|
|
|
|
|
print('We have %d neopixels.\n' % neo.get_len()) |
|
|
|
print('We have %d neopixels.\n' % neo.get_len()) |
|
|
@ -81,4 +84,5 @@ if False: |
|
|
|
|
|
|
|
|
|
|
|
if True: |
|
|
|
if True: |
|
|
|
spi = gex.SPI(client, 'spi') |
|
|
|
spi = gex.SPI(client, 'spi') |
|
|
|
print(spi.query(0, [0xDE, 0xAD, 0xBE, 0xEF], rlen=4, rskip=1)) |
|
|
|
spi.multicast(1, [0xDE, 0xAD, 0xBE, 0xEF]) |
|
|
|
|
|
|
|
print(spi.query(0, [0xDE, 0xAD, 0xBE, 0xEF], rlen=4, rskip=1))# |
|
|
|