initial test to support the 1-LED-strip mode
parent
9710a7f87f
commit
db4bd6927b
|
@ -8,6 +8,8 @@ errorCount = 0
|
||||||
framerate = 30
|
framerate = 30
|
||||||
dimension = 0
|
dimension = 0
|
||||||
|
|
||||||
|
long_line = False
|
||||||
|
|
||||||
ledSerial = None
|
ledSerial = None
|
||||||
data = None
|
data = None
|
||||||
|
|
||||||
|
@ -51,6 +53,13 @@ def image2data(data):
|
||||||
if b > 127:
|
if b > 127:
|
||||||
# Convert to signed bytes (expected by jarray)
|
# Convert to signed bytes (expected by jarray)
|
||||||
b -= 2**8
|
b -= 2**8
|
||||||
|
if long_line:
|
||||||
|
if x/width%2 == 0:
|
||||||
|
data[offset] = b
|
||||||
|
else:
|
||||||
|
# TODO: write data in the opposite order
|
||||||
|
pass
|
||||||
|
else:
|
||||||
data[offset] = b
|
data[offset] = b
|
||||||
offset += 1
|
offset += 1
|
||||||
imgmask >>= 1
|
imgmask >>= 1
|
||||||
|
@ -79,7 +88,7 @@ def prepare_data():
|
||||||
def setup():
|
def setup():
|
||||||
global gammatable
|
global gammatable
|
||||||
global dimension
|
global dimension
|
||||||
size(700, 1)
|
size(8, 5)
|
||||||
dimension = width * height
|
dimension = width * height
|
||||||
frameRate(framerate)
|
frameRate(framerate)
|
||||||
serialConfigure("/dev/ttyACM0")
|
serialConfigure("/dev/ttyACM0")
|
||||||
|
|
Loading…
Reference in New Issue