1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

re-add line drawing to unicorn hat node

This commit is contained in:
Dave Conway-Jones 2016-03-22 20:25:20 +00:00
parent d17ac7eb2e
commit 3cb42712bc
2 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pi-unicorn-hat",
"version" : "0.0.6",
"version" : "0.0.7",
"description" : "A Node-RED node to output to a Raspberry Pi Unicorn HAT from Pimorini.",
"dependencies" : {
"pngjs": "2.2.*"

View File

@ -39,7 +39,19 @@ while True:
data = data[1:].strip()
s = data.split(',')
for p in range(0,len(s),5):
UH.set_pixel(int(s[p]),int(s[p+1]),int(s[p+2]),int(s[p+3]),int(s[p+4]))
j = 1
if (s[p] == "*") and (s[p+1] == "*"):
for i in range(0,8):
for j in range(0,8):
UH.set_pixel(i,j,int(s[p+2]),int(s[p+3]),int(s[p+4]))
elif s[p] == "*":
for i in range(0,8):
UH.set_pixel(i,int(s[p+1]),int(s[p+2]),int(s[p+3]),int(s[p+4]))
elif s[p+1] == "*":
for i in range(0,8):
UH.set_pixel(int(s[p]),i,int(s[p+2]),int(s[p+3]),int(s[p+4]))
else :
UH.set_pixel(int(s[p]),int(s[p+1]),int(s[p+2]),int(s[p+3]),int(s[p+4]))
else:
q = 0
for p in range(64):