mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
2 lines
4.9 KiB
JSON
2 lines
4.9 KiB
JSON
[{"id":"651b51cb.9ae4b","type":"rpi-unicorn","z":"40b203f2.bf4dfc","name":"","png":"0,0,0","bright":"20","x":670,"y":120,"wires":[]},{"id":"738418f2.8c7be8","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":80,"wires":[["f4b1a57c.0b4e58"]]},{"id":"f4b1a57c.0b4e58","type":"function","z":"40b203f2.bf4dfc","name":"Random pixel","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\",\"+rnd(8)+\",\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":80,"wires":[["651b51cb.9ae4b"]]},{"id":"521bcb52.cdacd4","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":240,"wires":[["339d717e.b7dcbe"]]},{"id":"1ead517.f6ea2af","type":"function","z":"40b203f2.bf4dfc","name":"Random block","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\"-\"+rnd(8)+\",\"+rnd(8)+\"-\"+rnd(8)+\",\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":280,"wires":[["651b51cb.9ae4b"]]},{"id":"3b0f093.055fdf6","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":280,"wires":[["1ead517.f6ea2af"]]},{"id":"78fb1275.1edcfc","type":"function","z":"40b203f2.bf4dfc","name":"Random partial horzontal line","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\"-\"+rnd(8)+\",\"+rnd(8)+\",\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":200,"wires":[["651b51cb.9ae4b"]]},{"id":"39a26a50.73f696","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":200,"wires":[["78fb1275.1edcfc"]]},{"id":"a64899c7.7a26a8","type":"comment","z":"40b203f2.bf4dfc","name":"Unicorn Examples","info":"Simple exmplaes of drawing random colour pixels\n, full lines, partial lines and rectangles.\n\nAnd two simple \"sprites\", named by their `msg.topic` \nproperty that can move independantly of the background.","x":160,"y":40,"wires":[]},{"id":"300f653.741879a","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":160,"wires":[["d8af4e17.7d6fb"]]},{"id":"6f424fd0.170e4","type":"function","z":"40b203f2.bf4dfc","name":"Random horizontal line","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = \"*,\"+rnd(8)+\",\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":120,"wires":[["651b51cb.9ae4b"]]},{"id":"63f3f789.31d5b8","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":120,"wires":[["6f424fd0.170e4"]]},{"id":"d8af4e17.7d6fb","type":"function","z":"40b203f2.bf4dfc","name":"Random vertical line","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\",*,\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":160,"wires":[["651b51cb.9ae4b"]]},{"id":"339d717e.b7dcbe","type":"function","z":"40b203f2.bf4dfc","name":"Random partial vertical line","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\",\"+rnd(8)+\"-\"+rnd(8)+\",\"+rnd(256)+\",\"+rnd(256)+\",\"+rnd(256);\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":240,"wires":[["651b51cb.9ae4b"]]},{"id":"70b1ae04.a9fc8","type":"inject","z":"40b203f2.bf4dfc","name":"Clear screen","topic":"","payload":"CLS","payloadType":"str","repeat":"","crontab":"","once":false,"x":390,"y":40,"wires":[["651b51cb.9ae4b"]]},{"id":"85a534a6.be6a18","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":340,"wires":[["19299a90.447b95"]]},{"id":"19299a90.447b95","type":"function","z":"40b203f2.bf4dfc","name":"Random red sprite","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\",\"+rnd(8)+\",255,0,0\";\nmsg.topic = \"s1\"; // give the sprite a name\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":340,"wires":[["651b51cb.9ae4b"]]},{"id":"6936a42e.a0abfc","type":"inject","z":"40b203f2.bf4dfc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":380,"wires":[["9478822a.49e9d"]]},{"id":"9478822a.49e9d","type":"function","z":"40b203f2.bf4dfc","name":"Random blue sprite","func":"\nfunction rnd(r) {\n return parseInt(Math.random()*r);\n}\n\nmsg.payload = rnd(8)+\",\"+rnd(8)+\",0,0,255\";\nmsg.topic = \"s2\"; // give the sprite a name (different from the red one)\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":380,"wires":[["651b51cb.9ae4b"]]}]
|