Permalink
Browse files

receiver code works with ws281x

  • Loading branch information...
osresearch committed Jan 1, 2000
1 parent c64738d commit 7fdd3c6e52b40a1a42d456ddfeec7ed8a50e2758
Showing with 8 additions and 7 deletions.
  1. +2 −2 matrix-udp-rx.c
  2. +6 −5 python-test
View
@@ -59,7 +59,7 @@ main(
die("socket port %d failed: %s\n", port, strerror(errno));
const unsigned width = 256;
- const unsigned height = 64;
+ const unsigned height = 48;
const size_t image_size = width * height * 3;
// largest possible UDP packet
@@ -76,7 +76,7 @@ main(
unsigned long delta_sum = 0;
unsigned frames = 0;
- uint32_t * const fb = calloc(width*128,4);
+ uint32_t * const fb = calloc(width*height,4);
while (1)
{
View
@@ -18,8 +18,9 @@ font_sm = ImageFont.truetype("pf_tempesta_seven.ttf", 8)
i = 0
width = 256
-disp = Image.new("RGB", (256,16), "black")
-im = Image.new("RGB", (width,16), "black")
+height = 48
+disp = Image.new("RGB", (width,height), "black")
+im = Image.new("RGB", (width,height), "black")
im_draw = ImageDraw.Draw(im)
disp_draw = ImageDraw.Draw(disp)
@@ -29,7 +30,7 @@ def rainbow(i):
while True:
- im.paste("black", (0,0,width,16))
+ im.paste("black", (0,0,width,height))
now = datetime.datetime.now()
d = now.strftime("%a %d %b %Y")
t = now.strftime("%H:%M")
@@ -38,8 +39,8 @@ while True:
im_draw.text((0, -2), d, font=font, fill=rainbow(i))
# Make it scroll
- disp.paste(im.crop((0,0,i,16)), (256-i,0))
- disp.paste(im.crop((i+1,0,255,16)), (0,0))
+ disp.paste(im.crop((0,0,i,height)), (width-i,0))
+ disp.paste(im.crop((i+1,0,width-1,height)), (0,0))
# draw the time on each face
for x in range(0,7):

0 comments on commit 7fdd3c6

Please sign in to comment.