diff options
author | jaseg <jaseg@jaseg.net> | 2014-01-03 00:10:20 +0100 |
---|---|---|
committer | jaseg <jaseg@jaseg.net> | 2014-01-03 00:10:20 +0100 |
commit | 916aced1bef07001ef4eee2a1cde6cd6e33b4bc3 (patch) | |
tree | a8af06f0dcc65645801a2e20db64ca877b288f98 /host/matelight/host.py | |
parent | 34def4f660108632a9526c9ad3195fdb883d206d (diff) | |
download | matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.gz matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.bz2 matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.zip |
Now with even more abstract art.
Diffstat (limited to 'host/matelight/host.py')
-rw-r--r-- | host/matelight/host.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/host/matelight/host.py b/host/matelight/host.py deleted file mode 100644 index 4fa8578..0000000 --- a/host/matelight/host.py +++ /dev/null @@ -1,19 +0,0 @@ -import usb -import colorsys -import numpy as np -from config import * -import itertools - -dev = usb.core.find(idVendor=0x1cbe, idProduct=0x0003) - -def sendframe(framedata): - # not isinstance(framedata, np.array) or - if framedata.shape != (DISPLAY_HEIGHT, DISPLAY_WIDTH, 3) or framedata.dtype != np.uint8: - raise ValueError('framedata must be a ({}, {}, 3)-numpy array of uint8s. Got a {}-numpy array of {}'.format(DISPLAY_HEIGHT, DISPLAY_WIDTH, framedata.shape, framedata.dtype)) - - for cy, cx in itertools.product(range(CRATES_Y), range(CRATES_X)): - cratedata = framedata[cy*CRATE_HEIGHT:(cy+1)*CRATE_HEIGHT, cx*CRATE_WIDTH:(cx+1)*CRATE_WIDTH] - # Send framebuffer data - dev.write(0x01, bytes([0, cx, cy])+bytes(list(cratedata.flatten()))) - # Send latch command - dev.write(0x01, b'\x01') |