Skip to content

Instantly share code, notes, and snippets.

@LuisFDuarte
Last active August 29, 2015 14:09
Show Gist options
  • Save LuisFDuarte/d15ae51f710780abbe33 to your computer and use it in GitHub Desktop.
Save LuisFDuarte/d15ae51f710780abbe33 to your computer and use it in GitHub Desktop.
[{"id":"9bf9ca58.640638","type":"rpi-gpio in","name":"","intype":"tri","pin":"7","x":101.66668701171875,"y":433.5555419921875,"z":"c3aed0d3.3ce58","wires":[["5e029550.a1fd6c","7d6c3fc1.8293c"]]},{"id":"5e029550.a1fd6c","type":"function","name":"rising edge","func":"// initialise the counter to 0 if it doesn't exist already\ncontext.peoplecount = context.peoplecount || 0; \nif(msg.payload==1){\n\tcontext.peoplecount += 1;\n// make it part of the outgoing msg object\n}\nmsg.peoplecount = context.peoplecount;\n\nreturn msg","outputs":1,"x":303.25,"y":434,"z":"c3aed0d3.3ce58","wires":[["583faff4.a7c05","e366cd03.1c993"]]},{"id":"583faff4.a7c05","type":"debug","name":"People Count","active":true,"console":"true","complete":"true","x":487.25,"y":339.75,"z":"c3aed0d3.3ce58","wires":[]},{"id":"80f1ec3.f7f0e1","type":"debug","name":"contador","active":true,"console":"true","complete":"false","x":682,"y":344,"z":"c3aed0d3.3ce58","wires":[]},{"id":"5d876941.a27898","type":"ubidots","name":"ubidots","auth_token":"40RwMVjyvD9H360HOu7p191MoqSHg4","variable_id":"53e262127625421973e7cdb5","x":674,"y":434,"z":"c3aed0d3.3ce58","wires":[]},{"id":"e366cd03.1c993","type":"function","name":"","func":"var obj = JSON.parse(msg.peoplecount);\n\nmsg.payload = obj;\n\nreturn msg;","outputs":"1","x":501,"y":437,"z":"c3aed0d3.3ce58","wires":[["80f1ec3.f7f0e1","5d876941.a27898"]]},{"id":"7d6c3fc1.8293c","type":"debug","name":"Pin State","active":true,"console":"true","complete":"true","x":267,"y":346,"z":"c3aed0d3.3ce58","wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment