RPi – Test Flow – Selfie Station

To use copy and paste the below code into your Node-Red import window.

[{"id":"a55ecedd.0645c","type":"rpi-neopixels","z":"37a556b3.c240ba","name":"led ring","pixels":"12","bgnd":"","fgnd":"","wipe":"0","mode":"pixels","rgb":"rgb","brightness":"80","gamma":true,"x":700,"y":60,"wires":[]},{"id":"87ed0744.98f828","type":"camerapi-takephoto","z":"37a556b3.c240ba","filemode":"2","filename":"","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"9","rotation":"0","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","quality":"80","imageeffect":"none","exposuremode":"auto","iso":"0","agcwait":"1.0","led":"0","awb":"auto","name":"","x":220,"y":340,"wires":[["ff1b217a.3a134","1b3e1abe.0e8145"]]},{"id":"7658355c.89396c","type":"rpi-gpio in","z":"37a556b3.c240ba","name":"","pin":"32","intype":"down","debounce":"25","read":false,"x":80,"y":60,"wires":[["6872ffde.e33c9"]]},{"id":"eb0fc181.49dd7","type":"exec","z":"37a556b3.c240ba","command":"DISPLAY=:0.0 gpicview","addpay":true,"append":"&","useSpawn":"false","timer":"","oldrc":false,"name":"Open image file","x":500,"y":460,"wires":[[],[],[]]},{"id":"ff1b217a.3a134","type":"function","z":"37a556b3.c240ba","name":"Check if filename payload","func":"if(msg.payload.length > 5)\n    return msg;","outputs":1,"noerr":0,"x":270,"y":460,"wires":[["eb0fc181.49dd7"]]},{"id":"6872ffde.e33c9","type":"delay","z":"37a556b3.c240ba","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":60,"wires":[["d88eb221.18aaa","2f031fd.94cf5e"]]},{"id":"1b3e1abe.0e8145","type":"change","z":"37a556b3.c240ba","name":"turn off LED ring","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,12,0,0,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":340,"wires":[["a55ecedd.0645c"]]},{"id":"d88eb221.18aaa","type":"delay","z":"37a556b3.c240ba","name":"","pauseType":"delay","timeout":".5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":280,"y":120,"wires":[["3bf98e22.205622","95e7c6b7.584908"]]},{"id":"2f031fd.94cf5e","type":"change","z":"37a556b3.c240ba","name":"Set LED ring = Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"1,12,0,255,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":60,"wires":[["a55ecedd.0645c"]]},{"id":"3bf98e22.205622","type":"change","z":"37a556b3.c240ba","name":"Set LED ring = Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,12,255,0,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":120,"wires":[["a55ecedd.0645c"]]},{"id":"2fae3801.80ef68","type":"change","z":"37a556b3.c240ba","name":"Set LED ring = Blue","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,12,0,0,255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":180,"wires":[["a55ecedd.0645c"]]},{"id":"95e7c6b7.584908","type":"delay","z":"37a556b3.c240ba","name":"","pauseType":"delay","timeout":".5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":280,"y":180,"wires":[["2fae3801.80ef68","ce6b30a5.01a5f"]]},{"id":"d8514317.e48f7","type":"change","z":"37a556b3.c240ba","name":"Set LED ring = White","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,12,255,255,255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":240,"wires":[["a55ecedd.0645c"]]},{"id":"ce6b30a5.01a5f","type":"delay","z":"37a556b3.c240ba","name":"","pauseType":"delay","timeout":".5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":280,"y":240,"wires":[["d8514317.e48f7","87ed0744.98f828"]]}]

 

image_pdfGenerate PDFimage_printPrint
Posted in Flows - Experiments.

Leave a Reply