From ea9356a3cc07b2a93b0f8d67be7471507d362ca8 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 26 Feb 2016 22:01:00 +0000 Subject: [PATCH] update unicorn hat node for faster writing of pixels --- hardware/unicorn/README.md | 5 +- hardware/unicorn/package.json | 2 +- hardware/unicorn/unicorn.html | 21 +++--- hardware/unicorn/unicorn.js | 119 ++++++++++++++++++++-------------- hardware/unicorn/unihat.py | 16 +++-- 5 files changed, 95 insertions(+), 68 deletions(-) diff --git a/hardware/unicorn/README.md b/hardware/unicorn/README.md index 02a3691f..c24d1eaa 100644 --- a/hardware/unicorn/README.md +++ b/hardware/unicorn/README.md @@ -34,11 +34,12 @@ A pixel is set by **msg.payload** with a CSV string `x,y,r,g,b` , where x and y are 0 to 7, and r, g and b are 0 - 255. If `x` or `y` are set to `*` then the complete row or column can be set. Setting both `x` and `y` to `*` fills the background. +Multiple pixels can be specified at once by using `x1,y1,r1,g1,b1,x2,y2,r2,g2,b2,...` etc The background can also be set to a colour by setting **msg.payload** to an r,g,b triple. -Any msg with a **msg.topic** identifies a 'sprite' pixel, which can then be moved -independently of the background. A 'sprite' can be a single pixel or a complete line. +Any msg with a **msg.topic** identifies a 'sprite', which can then be moved +independently of the background. A 'sprite' can be a single pixel, or a group of pixels. Setting **msg.payload** to `0` will delete the sprite from the list identified by **msg.topic**. diff --git a/hardware/unicorn/package.json b/hardware/unicorn/package.json index 6359f866..bd2f6401 100644 --- a/hardware/unicorn/package.json +++ b/hardware/unicorn/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-pi-unicorn-hat", - "version" : "0.0.2", + "version" : "0.0.3", "description" : "A Node-RED node to output to a Raspberry Pi Unicorn HAT from Pimorini.", "dependencies" : { "pngjs": "2.2.*" diff --git a/hardware/unicorn/unicorn.html b/hardware/unicorn/unicorn.html index d2274224..71dcad36 100644 --- a/hardware/unicorn/unicorn.html +++ b/hardware/unicorn/unicorn.html @@ -33,17 +33,18 @@