/
AdvertisingSignTotalFlow.rtf
8 lines (7 loc) · 10.5 KB
/
AdvertisingSignTotalFlow.rtf
1
2
3
4
5
6
7
8
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\f0\fs24 \cf0 [\{"id":"65ee1950.6b6e08","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 2","pin":"15","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":800,"wires":[]\},\{"id":"61c89a84.d85294","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 3","pin":"13","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":880,"wires":[]\},\{"id":"e58833ab.947e1","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 4","pin":"11","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":980,"wires":[]\},\{"id":"5e3ee3ae.dc827c","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 5","pin":"7","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":1080,"wires":[]\},\{"id":"fc695ce8.6e354","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 6","pin":"5","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":1180,"wires":[]\},\{"id":"9f6d9ff4.3cf31","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 7","pin":"3","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":1280,"wires":[]\},\{"id":"6c973721.e30f68","type":"pimcp3008","z":"bf7c8196.47ee2","name":"","dev":"3008","pin":0,"dnum":0,"x":270,"y":900,"wires":[["2edbe753.bd1d88"]]\},\{"id":"8589d11.b07c03","type":"pimcp3008","z":"bf7c8196.47ee2","name":"","dev":"3008","pin":"1","dnum":0,"x":270,"y":560,"wires":[["d1819461.29f668"]]\},\{"id":"fce5550c.3dfee8","type":"inject","z":"bf7c8196.47ee2","name":"","topic":"adc/1","payload":"10","payloadType":"num","repeat":"","crontab":"","once":true,"x":320,"y":660,"wires":[["7af99b8c.8e6734"]]\},\{"id":"7af99b8c.8e6734","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"\}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":600,"wires":[["6d4aee4d.edeba"]]\},\{"id":"96e859aa.74bfb8","type":"function","z":"bf7c8196.47ee2","name":"process","func":"// this bit is just for testing, so you can convince yourself it works ;)\\nif (msg.topic==\\"reset\\") \{\\n context.set(\\"delay\\", undefined);\\n\}\\n\\n\\nif (msg.topic == \\"adc/1\\") \{\\n // store the delay\\n context.set(\\"delay\\", msg.delay);\\n node.warn(\\"delay captured from adc/1: \\"+msg.delay);\\n // just swallow the message - don't return anything\\n\}\\nif (msg.topic == \\"adc/0\\") \{\\n // make sure we have a delay value to return\\n if (context.get(\\"delay\\")) \{\\n node.warn(\\"got: \\"+msg.payload+\\" from adc/0\\");\\n // get the delay from adc/1\\n msg.delay = context.get(\\"delay\\");\\n // and keep the current payload of adc/0\\n \\n // send it on to the light controller\\n return msg;\\n \}\\n else \{\\n node.warn(\\"no delay value stored yet, so ignoring adc/0 reading\\");\\n \}\\n\}\\n","outputs":1,"noerr":0,"x":920,"y":700,"wires":[["a4fda4ec.1600c8","280abf0f.3b0d6","a2311f4b.9be93"]]\},\{"id":"c41fb08d.8d86b","type":"inject","z":"bf7c8196.47ee2","name":"","topic":"adc/0","payload":"20","payloadType":"num","repeat":"","crontab":"","once":true,"x":320,"y":740,"wires":[["96e859aa.74bfb8"]]\},\{"id":"a4fda4ec.1600c8","type":"debug","z":"bf7c8196.47ee2","name":"","active":true,"console":"false","complete":"true","x":1110,"y":600,"wires":[]\},\{"id":"7d9024c1.6fe72c","type":"inject","z":"bf7c8196.47ee2","name":"reset","topic":"reset","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":310,"y":700,"wires":[["96e859aa.74bfb8"]]\},\{"id":"2edbe753.bd1d88","type":"function","z":"bf7c8196.47ee2","name":"Brightness","func":"// Divide output by 10.24\\nmsg.payload = msg.payload/10.24;\\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":900,"wires":[["96e859aa.74bfb8"]]\},\{"id":"280abf0f.3b0d6","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":700,"wires":[["3439e51a.df750a"]]\},\{"id":"a2311f4b.9be93","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":800,"wires":[["a0424831.d76b38","110d9c71.9a8d74","afaf5c22.f6743"]]\},\{"id":"a0424831.d76b38","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":760,"wires":[["280abf0f.3b0d6"]]\},\{"id":"d1819461.29f668","type":"function","z":"bf7c8196.47ee2","name":"Speed","func":"// Divide output by 10.24\\nmsg.payload = msg.payload*4;\\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":560,"wires":[["7af99b8c.8e6734"]]\},\{"id":"6d4aee4d.edeba","type":"switch","z":"bf7c8196.47ee2","name":"","property":"delay","propertyType":"msg","rules":[\{"t":"lt","v":"1000","vt":"str"\},\{"t":"else"\}],"checkall":"true","outputs":2,"x":690,"y":600,"wires":[["964387fd.1ca0f8"],["96e859aa.74bfb8"]]\},\{"id":"964387fd.1ca0f8","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"delay","pt":"msg","to":"1000","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":580,"wires":[["96e859aa.74bfb8"]]\},\{"id":"1267849f.8d7cdb","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":140,"y":620,"wires":[["8589d11.b07c03"]]\},\{"id":"e638b6eb.3f15f8","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":960,"wires":[["6c973721.e30f68"]]\},\{"id":"3439e51a.df750a","type":"rpi-gpio out","z":"bf7c8196.47ee2","name":"Lamp 1","pin":"35","set":"","level":"0","freq":"","out":"pwm","x":1400,"y":700,"wires":[]\},\{"id":"a47b7b53.9879f8","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":840,"wires":[["110d9c71.9a8d74"]]\},\{"id":"110d9c71.9a8d74","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":800,"wires":[["65ee1950.6b6e08"]]\},\{"id":"9687aefe.4620e","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":880,"wires":[["61c89a84.d85294"]]\},\{"id":"afaf5c22.f6743","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":880,"wires":[["c32134dd.f4b0d8","a47b7b53.9879f8","9687aefe.4620e"]]\},\{"id":"c32134dd.f4b0d8","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":980,"wires":[["29837d2a.4dd732","90f0b986.1b1f78","f4d6a736.7265d8"]]\},\{"id":"90f0b986.1b1f78","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":940,"wires":[["9687aefe.4620e"]]\},\{"id":"29837d2a.4dd732","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":1080,"wires":[["84f8a481.94aa28","23cf29d2.dd6836","3fea4cb9.6a4364"]]\},\{"id":"f4d6a736.7265d8","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":980,"wires":[["e58833ab.947e1"]]\},\{"id":"84f8a481.94aa28","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":1080,"wires":[["5e3ee3ae.dc827c"]]\},\{"id":"23cf29d2.dd6836","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1040,"wires":[["f4d6a736.7265d8"]]\},\{"id":"b81b0cad.c5ab3","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1140,"wires":[["84f8a481.94aa28"]]\},\{"id":"960c5563.ba0958","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":1180,"wires":[["fc695ce8.6e354"]]\},\{"id":"3fea4cb9.6a4364","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":1180,"wires":[["56b87fba.4954","b81b0cad.c5ab3","960c5563.ba0958"]]\},\{"id":"56b87fba.4954","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1040,"y":1280,"wires":[["f991c046.f4879","fdf77442.5954a8","187ea5f2.bc696a"]]\},\{"id":"f991c046.f4879","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1240,"wires":[["960c5563.ba0958"]]\},\{"id":"fdf77442.5954a8","type":"function","z":"bf7c8196.47ee2","name":"","func":"\\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":1280,"wires":[["9f6d9ff4.3cf31"]]\},\{"id":"a635d531.737708","type":"change","z":"bf7c8196.47ee2","name":"","rules":[\{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"\}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1480,"wires":[["fdf77442.5954a8"]]\},\{"id":"187ea5f2.bc696a","type":"delay","z":"bf7c8196.47ee2","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1040,"y":1480,"wires":[["a635d531.737708","e638b6eb.3f15f8","1267849f.8d7cdb"]]\}]}