easybotics-led-matrix nyan cat
Uses the image node from the easybotics-led-matrix library to display an animated gif, along with some randomly generated and coloured circles.
[{"id":"487abd27.f54cd4","type":"inject","z":"9bffdce9.185bb","name":"0.1 Seconds Nyan Cat","topic":"","payload":"https://media.giphy.com/media/UaoxTrl8z1wre/giphy.gif","payloadType":"str","repeat":"0.25","crontab":"","once":true,"onceDelay":0.1,"x":200,"y":180,"wires":[["d4c8e97c.3e0f18"]]},{"id":"8d7cce34.7eafa","type":"image-to-matrix","z":"9bffdce9.185bb","name":"","file":"","xOffset":"64","yOffset":"10","matrix":"9b09c013.e6c5b","zLevel":"","x":810,"y":160,"wires":[]},{"id":"35f23c39.7586f4","type":"function","z":"9bffdce9.185bb","name":"random circle","func":"var randInt = function (max)\n{\n return Math.floor(Math.random() * Math.floor(max));\n}\n\nvar randColor = function()\n{\n return randInt(256) + ',' + randInt(256) + ',' + randInt(256);\n}\n\n// node.log(randColor()); send to terminal for debugging\n\nvar circle = \n{ x: randInt(128), y: randInt(64), radius: randInt(10), rgb: randColor()\n};\n\n\n\nvar payload = { data: circle};\nmsg.payload = payload; \nreturn msg;\n","outputs":1,"noerr":0,"x":460,"y":300,"wires":[["279368fd.bd5fb8"]]},{"id":"9f8fee11.0f22a","type":"function","z":"9bffdce9.185bb","name":"random circle","func":"var randInt = function (max)\n{\n return Math.floor(Math.random() * Math.floor(max));\n}\n\nvar randColor = function()\n{\n return randInt(256) + ',' + randInt(256) + ',' + randInt(256);\n}\n\n// node.log(randColor()); send to terminal for debugging\n\nvar circle = \n{ x: randInt(128), y: randInt(64), radius: randInt(10), rgb: randColor()\n};\n\n\n\nvar payload = { data: circle};\nmsg.payload = payload; \nreturn msg;\n","outputs":1,"noerr":0,"x":460,"y":340,"wires":[["279368fd.bd5fb8"]]},{"id":"1d3bd36f.6f6cdd","type":"function","z":"9bffdce9.185bb","name":"random circle","func":"var randInt = function (max)\n{\n return Math.floor(Math.random() * Math.floor(max));\n}\n\nvar randColor = function()\n{\n return randInt(256) + ',' + randInt(256) + ',' + randInt(256);\n}\n\n// node.log(randColor()); send to terminal for debugging\n\nvar circle = \n{ x: randInt(128), y: randInt(64), radius: randInt(10), rgb: randColor()\n};\n\n\n\nvar payload = { data: circle};\nmsg.payload = payload; \nreturn msg;\n","outputs":1,"noerr":0,"x":460,"y":380,"wires":[["279368fd.bd5fb8"]]},{"id":"44b3038c.ca4c4c","type":"inject","z":"9bffdce9.185bb","name":"0.1","topic":"","payload":"1","payloadType":"str","repeat":"0.25","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":320,"wires":[["35f23c39.7586f4","9f8fee11.0f22a","1d3bd36f.6f6cdd"]]},{"id":"78cb7a43.0e4164","type":"inject","z":"9bffdce9.185bb","name":"0.1","topic":"","payload":"EASYBOTICS.COM","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":190,"y":560,"wires":[["120aca5d.d35096"]]},{"id":"120aca5d.d35096","type":"text-to-matrix","z":"9bffdce9.185bb","name":"","xOffset":"50","yOffset":"54","rgb":"0,255,41","font":"5x8.bdf","prefix":"","source":"msg.payload","matrix":"9b09c013.e6c5b","zLevel":"","x":680,"y":560,"wires":[]},{"id":"d4c8e97c.3e0f18","type":"function","z":"9bffdce9.185bb","name":"Increment Circle Location","func":"\n\nvar y = 20;\nvar x = flow.get(\"x\") || 0;\n\nif(x > 128) x = 0; \nif(y > 64) y = 0;\nif(x < 0) x = 128; \nif(y < 0) y = 64;\n\nvar cat = \n{ data: msg.payload, x: x, y: y\n};\nflow.set(\"x\", ++x);\n\n\n\nmsg.payload = cat; \n\nreturn msg;\n","outputs":1,"noerr":0,"x":520,"y":180,"wires":[["8d7cce34.7eafa"]]},{"id":"279368fd.bd5fb8","type":"circle","z":"9bffdce9.185bb","name":"","xPos":0,"yPos":0,"radius":0,"rgb":"0,255,41","matrix":"9b09c013.e6c5b","zLevel":"","x":740,"y":340,"wires":[]},{"id":"9b09c013.e6c5b","type":"led-matrix","z":"","height":"64","width":"64","chained":"2","parallel":"1","brightness":"50","refreshDelay":"100","mapping":"adafruit-hat-pwm","autoRefresh":true}]