Published © CC BY-NC-SA

Push up Counter

The project will allow you to automatically count your Pushups with a motion sensor.

IntermediateFull instructions provided12 minutes200
Push up Counter

Things used in this project

Hardware components

LED (generic)
LED (generic)
×2
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Jumper wires (generic)
Jumper wires (generic)
×14
Power Supply DIY Kit
Quantum Integration Power Supply DIY Kit
×1
Quantum Starter Bundle
Quantum Integration Quantum Starter Bundle
×1
Quantum Component Kit
Quantum Integration Quantum Component Kit
×1

Software apps and online services

Quantum Integration Platform
Quantum Integration Platform

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Fritzing

3D Files

Schematics

14_LAlPPuAG8D.png

15_ginJOJe5D0.png

Code

Pushup Counter App.json

JSON
{"id":"5","name":"Pushup Counter","identifier":"Pushup Counter","offsetX":316.918024688301,"offsetY":177.7606794743835,"zoom":55.17065429687496,"gridSize":0,"links":[{"id":"29","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"c256573f-9ff1-4ee7-8633-dc2ccd9f6981","selected":false,"x":-265.313,"y":173.484},{"id":"95adaac4-09ac-4ec7-aa46-5ab3b514c187","selected":false,"x":-138.108,"y":66.039},{"id":"bd440068-8a35-4172-a751-9c0135e8b090","selected":false,"x":-1.437,"y":70.641}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"17","target":"22","sourcePort":"95","targetPort":"109"},{"id":"30","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"87e4e595-27cc-4136-9c4f-92bb051774ca","selected":false,"x":-265.313,"y":173.484},{"id":"55f612ba-4592-4938-823b-c2dd20097c32","selected":false,"x":-138.108,"y":244.18},{"id":"379fb1d7-81e5-4518-89f1-1d480855c35b","selected":false,"x":-2.219,"y":248.109}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"17","target":"23","sourcePort":"95","targetPort":"115"},{"id":"31","internalFlowId":"4b916e92-d23d-4543-94ca-231fc627dc0e","type":"default","selected":false,"points":[{"id":"3096db4b-2224-4d16-a190-a3d3fe971a48","selected":false,"x":162.57813467880902,"y":48.64059844581791},{"id":"4f8dc48f-1fce-48e0-ad6d-963bee0e5646","selected":false,"x":307.32814249885337,"y":116.35935508303598}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"22","target":"20","sourcePort":"111","targetPort":"100"},{"id":"32","internalFlowId":"bf7920e5-bcaa-452a-8061-560850e830a1","type":"default","selected":false,"points":[{"id":"f730af10-3497-4f14-ae72-14d16a096b3a","selected":false,"x":162.57813467880902,"y":92.64062472688045},{"id":"d9aac0c4-c57a-416a-92bf-f34126e0b9ea","selected":false,"x":307.32814249885337,"y":116.35935508303598}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"22","target":"20","sourcePort":"113","targetPort":"100"},{"id":"33","internalFlowId":"2285bf6d-0c2f-4e68-b9a8-ada9fae14829","type":"default","selected":false,"points":[{"id":"e1546983-0235-4ea7-876c-769dd0d1ab83","selected":false,"x":161.79690152850515,"y":248.10936390290343},{"id":"d1f275b4-61e1-4c94-acf4-bb38c383dab3","selected":false,"x":302.35939339601606,"y":267.20312716394915}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"23","target":"21","sourcePort":"118","targetPort":"105"},{"id":"34","internalFlowId":"451f77c7-a83d-4f59-8ee4-2eff16299ddd","type":"default","selected":false,"points":[{"id":"38ef8d03-a404-4d8e-b0cf-10f7306aa82e","selected":false,"x":161.79690152850515,"y":270.1093556186555},{"id":"393b4f27-0bbd-40fc-be73-cd6da925d555","selected":false,"x":302.35939339601606,"y":267.20312716394915}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"23","target":"21","sourcePort":"119","targetPort":"105"},{"id":"35","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"a4d208ab-bf84-4509-b65c-f30f7c55eeaf","selected":false,"x":474.656,"y":72.359},{"id":"ecd2af30-b88b-476a-a851-eed51e072db2","selected":false,"x":684.313,"y":153.172}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"20","target":"24","sourcePort":"101","targetPort":"121"},{"id":"36","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"bd2db010-cd49-4b3f-817d-6db3ad23730e","selected":false,"x":469.688,"y":223.203},{"id":"606dc4c1-ced6-4514-b5ad-e76f43302b43","selected":false,"x":684.313,"y":175.172}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"21","target":"24","sourcePort":"106","targetPort":"122"},{"id":"37","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"eebe2af3-828a-4140-b31f-1745901cafac","selected":false,"x":848.328,"y":131.172},{"id":"a023d587-c075-4def-8baf-2f09fe595621","selected":false,"x":907.057,"y":128.022},{"id":"6bede9e4-a0f9-48c7-ad00-b4c1b76dd9b1","selected":false,"x":913.195,"y":-58.162},{"id":"f1e4fea8-40c2-420b-aadc-7ebba30bb3e7","selected":false,"x":252.343,"y":-54.07},{"id":"677a19b5-7b79-4c8b-8aee-08fd61f8c40f","selected":false,"x":254.389,"y":91.194},{"id":"826e61d9-5bd1-421f-b3a1-4c325e93589e","selected":false,"x":307.328,"y":94.359}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"20","sourcePort":"123","targetPort":"99"},{"id":"39","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"202c2eea-c721-406d-83be-8eab0edf294d","selected":false,"x":848.328,"y":131.172},{"id":"52b4f795-55b1-48d7-afba-21d1409a3472","selected":false,"x":909.103,"y":132.114},{"id":"7406ff39-da64-41df-a7d4-cbc97df0d427","selected":false,"x":909.103,"y":332.62},{"id":"f1401d0a-c2b3-47c3-b7a0-50366438be38","selected":false,"x":248.251,"y":336.712},{"id":"e74429f6-030d-402b-a373-2b337e17a15f","selected":false,"x":246.206,"y":242.597},{"id":"54ead01e-835e-40a1-b2c0-b9f6fa7aec6d","selected":false,"x":302.359,"y":245.203}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"21","sourcePort":"123","targetPort":"104"},{"id":"40","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"92c7e80a-58de-49a9-ae2e-a5ef6992c586","selected":false,"x":848.328,"y":131.172},{"id":"53fac708-1e6d-408e-a9f9-1e3b88c182e3","selected":false,"x":884.194,"y":114.42},{"id":"0aacebfe-b9b1-4dee-ba63-11512e9037ee","selected":false,"x":888.339,"y":-20.302},{"id":"7d9256d8-4337-46c0-863c-f7b9b3dd8de3","selected":false,"x":965.75,"y":-19.938}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"25","sourcePort":"123","targetPort":"124"},{"id":"41","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"1afdb17d-1154-4556-b59e-cc7a0329b7c0","selected":false,"x":1129.766,"y":-19.938},{"id":"5ce7b267-d4b9-467c-a66a-c88600531e87","selected":false,"x":1235,"y":-18.141}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"25","target":"26","sourcePort":"126","targetPort":"128"},{"id":"42","internalFlowId":"bdfdc5bf-e244-467b-b209-fa3f49d541fb","type":"default","selected":false,"points":[{"id":"a288e263-4840-492c-b8fa-3126f94c4b6c","selected":false,"x":848.328136943716,"y":131.171856966834},{"id":"0dfc11fd-9480-4441-bdd4-0fc4f845abb7","selected":false,"x":1193.0183469028932,"y":133.07389520402197},{"id":"9cb83b01-0694-457d-8d8e-a0b9eecb3c96","selected":false,"x":1193.0183469028932,"y":8.715113845188677},{"id":"8dc9cacd-bdec-41e3-b58b-fb3cfee0bed3","selected":false,"x":1235.0001505252171,"y":3.8593900951459688}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"26","sourcePort":"123","targetPort":"129"},{"id":"43","internalFlowId":"c53a4e6b-d093-4af0-ab3b-6971af7130f6","type":"default","selected":false,"points":[{"id":"bf68d45e-2960-4dca-96c3-aae3a30b8d7b","selected":false,"x":1402.3281394738024,"y":-40.140574483651676},{"id":"bd5570f4-0111-4d03-86df-596daa0a706a","selected":false,"x":1540.5781043688607,"y":-114.53123492462038}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"26","target":"19","sourcePort":"130","targetPort":"97"},{"id":"44","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"0e6ef6cd-e7e8-4cbd-9114-1e5c3fffd4a7","selected":false,"x":1402.328,"y":-18.141},{"id":"795dbffc-32a1-4bd2-8f17-75e558c55899","selected":false,"x":1535.5,"y":8.391}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"26","target":"18","sourcePort":"131","targetPort":"96"},{"id":"45","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"519bc9ac-802d-45d6-a7c3-6a8ec3e42bc6","selected":false,"x":848.328,"y":131.172},{"id":"d2b5b152-ad7a-40d5-9602-fb7dd4884b83","selected":false,"x":997.62,"y":144.874},{"id":"2c8b4191-f524-4b75-9b71-36080becd261","selected":false,"x":1083.645,"y":268.397},{"id":"6623b165-3c35-477c-a784-9e32443234f9","selected":false,"x":1169.062,"y":264.703}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"27","sourcePort":"123","targetPort":"132"},{"id":"46","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"0ed104bc-29a4-4b7e-8662-f8536c4104ed","selected":false,"x":848.328,"y":131.172},{"id":"c3e6373b-76c5-4293-a75e-b228da9bbf31","selected":false,"x":979.974,"y":151.491},{"id":"66d6daaa-be46-476b-9aea-1c2c14663517","selected":false,"x":1003.359,"y":477.251},{"id":"778e2b03-cd46-48a7-8875-fef6194c6886","selected":false,"x":1166.875,"y":476.734}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"24","target":"28","sourcePort":"123","targetPort":"138"},{"id":"47","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"843c99d2-6983-4b87-91dc-2382b1d8b8ac","selected":false,"x":1333.062,"y":264.703},{"id":"c770c314-c4a0-4bfb-96b6-de62f5d3243b","selected":false,"x":1403.18,"y":267.492},{"id":"b86c7d8c-47e6-4813-9cc8-5a4bcc00d3ae","selected":false,"x":1406.202,"y":355.122},{"id":"ae80088e-9f10-494b-b4ed-a5db3d0a0ab3","selected":false,"x":1667.547,"y":362.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"27","target":"16","sourcePort":"137","targetPort":"85"},{"id":"48","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"f3376688-4a0d-488e-b4dd-30061e7373d3","selected":false,"x":1333.062,"y":264.703},{"id":"05ed0cb4-397f-4354-945b-34d433c65eb2","selected":false,"x":1382.028,"y":265.981},{"id":"66329737-704e-4473-991b-f20356c0bd86","selected":false,"x":1382.028,"y":379.296},{"id":"be4dfda5-f2db-405a-9468-c0e8433dfa79","selected":false,"x":1667.547,"y":384.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"27","target":"16","sourcePort":"137","targetPort":"86"},{"id":"49","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"b2e148eb-e877-4223-a4ba-f2fb9edbf686","selected":false,"x":1330.875,"y":476.734},{"id":"450c58b9-bf32-4436-9b66-9d6a0582c931","selected":false,"x":1561.82,"y":480.523},{"id":"41adadc3-ffab-44a9-9220-e196e9c1a39b","selected":false,"x":1561.82,"y":401.959},{"id":"14fe8d9e-25a0-4e4a-b8f0-029e8ae105ec","selected":false,"x":1667.547,"y":406.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"28","target":"16","sourcePort":"140","targetPort":"87"},{"id":"50","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"0e9ea40c-df97-42bc-85e9-a5e524631d77","selected":false,"x":560.625,"y":649.063},{"id":"951f5b97-028e-4fb4-ae9c-607c61912b27","selected":false,"x":672.453,"y":647.438}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"29","target":"30","sourcePort":"141","targetPort":"142"},{"id":"51","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"5b84a229-c1fa-4985-a3d6-48a7298a8e96","selected":false,"x":560.625,"y":649.063},{"id":"808ff5e8-a310-4ff0-b55b-a92e965e9c5c","selected":false,"x":605.796,"y":648.617},{"id":"7279e158-ed7c-4076-9d82-b7c473ef0a65","selected":false,"x":607.588,"y":811.655},{"id":"fba2f7e6-46a0-4a20-af32-5492a6ae9691","selected":false,"x":1603.732,"y":808.072},{"id":"f4b8eb48-737e-4aec-8f5c-57553ccd8404","selected":false,"x":1598.357,"y":496.329},{"id":"9d866c78-0de3-41ee-825c-4b68140418c4","selected":false,"x":1667.547,"y":494.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"29","target":"16","sourcePort":"141","targetPort":"91"},{"id":"52","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"7c385784-6837-46cd-a59a-6c277337cdc8","selected":false,"x":836.469,"y":647.438},{"id":"99ce030b-e365-49c1-81c2-a35fc738bb43","selected":false,"x":1558.941,"y":650.409},{"id":"5dc5b470-43dc-48b5-bf7b-7627f53dadcc","selected":false,"x":1553.567,"y":383.457},{"id":"69cf3126-e5e8-40b5-8dde-d84c46d80b66","selected":false,"x":1667.547,"y":384.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"30","target":"16","sourcePort":"144","targetPort":"86"},{"id":"53","internalFlowId":null,"type":"default","selected":false,"points":[{"id":"a892b528-67f7-4e82-a15f-485d8ca29a33","selected":false,"x":836.469,"y":647.438},{"id":"0b93c895-267b-489e-a88c-c60ceeb7906e","selected":false,"x":1528.484,"y":648.617},{"id":"7c33c823-c8f9-4074-a5f2-232456c0359d","selected":false,"x":1530.275,"y":360.165},{"id":"1a4d4a26-11d5-4ac5-a63b-fca38b11cee5","selected":false,"x":1667.547,"y":362.406}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"30","target":"16","sourcePort":"144","targetPort":"85"},{"id":"54","internalFlowId":"67df16d1-f073-415e-b5f2-0f171472c359","type":"default","selected":false,"points":[{"id":"d6369b07-c993-4486-a6f7-9c2dffa55c11","selected":false,"x":-286.5781020020804,"y":-19.937504426108106},{"id":"1cc6b418-62c3-4742-bbb3-840db51e2e63","selected":true,"x":-1.4374473394788332,"y":70.6406577040014}],"labels":[],"width":3,"color":"rgba(255,255,255,0.5)","curvyness":50,"source":"31","target":"22","sourcePort":"147","targetPort":"109"}],"nodes":[{"id":"16","internalFlowId":"16","type":"quantum","selected":false,"x":1649.556,"y":315.916,"name":"LCD","mappingDescription":"No instructions defined!","description":"LCD Display that supports various formats to show strings.","color":"#02B0EF","qType":"Widget","originalName":"LCD","factoryId":"widget_lcd","properties":{"mappableCategory":{"category":5,"subCategory":5},"multiMapping":false,"manufacturer":"generic"},"ports":[{"id":"84","internalFlowId":"661718ed-6df1-4420-88fc-d5e6fcd6f203","type":"quantum","selected":false,"name":"7a44f189-86db-48f4-b8bd-234bdd6081e2","in":true,"label":"Display Signal","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"hidden":true,"clientService":{"key":"q_display","name":"Display","uuid":"bd53a92b-074e-5100-aac8-c734af1ff0c4","value_len":"var","props":["write"],"propChar":[{"key":"rows","title":"Rows","len":2},{"key":"columns","title":"Columns","len":2}],"signalType":{"key":"display","name":"Display","baseType":"JSON","internal":true,"defaultValue":{}},"characteristics":[{"key":"q_info","name":"Info Characteristic","uuid":"6375a20d-31ae-4456-aaf6-8fc84e3cce26","properties":["read"],"type":"utf-8"},{"key":"q_value","name":"Value Characteristic","uuid":"a97ba6d9-c409-4118-8735-b5bef87b9afd","properties":["write"],"type":"user"},{"key":"q_properties","name":"Prop Characteristic","uuid":"93d79faa-21ed-4ce7-b658-d9bcb06bd943","properties":["read"],"type":"utf-8"},{"key":"q_subClient","name":"Subclient Characteristic","uuid":"1270fde2-fd5e-4e4f-b866-241f105f7b15","properties":["read"],"type":"user"}],"drivers":["custom_HD447802x16","custom_LCD2004"]}},"signalType":{"key":"display","name":"Display","baseType":"JSON","internal":true,"defaultValue":{}},"index":0,"clients":[],"NodeId":16},{"id":"85","internalFlowId":"d993cb88-f32e-459e-8e9b-92ff8b81e71a","type":"quantum","selected":false,"name":"0c2dd063-13ba-430e-ad3e-f3a316d4da7a","in":true,"label":"Send to Display","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":16},{"id":"86","internalFlowId":"eec8c080-eb7d-40c3-9298-c8c99736fd88","type":"quantum","selected":false,"name":"a92ef423-19dd-47a5-bb94-73ab9d2a1765","in":true,"label":"String","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"string","name":"String","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":16},{"id":"87","internalFlowId":"595a2fe7-26bc-42f5-b110-cfc06c30874c","type":"quantum","selected":false,"name":"e9da0904-5f1c-4094-badc-1ef80fefc598","in":true,"label":"Column Position","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":3,"clients":[],"NodeId":16},{"id":"88","internalFlowId":"d77c1045-b4c0-4d53-8a1a-60df0248f907","type":"quantum","selected":false,"name":"0d34dc86-98d0-4a0c-ab17-31a3240e53fc","in":true,"label":"Row Position","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":4,"clients":[],"NodeId":16},{"id":"89","internalFlowId":"a3ff8aab-6ecf-476c-8137-379e23142502","type":"quantum","selected":false,"name":"edf554d6-f987-403c-bbdd-1f1122209d02","in":true,"label":"Home","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":5,"clients":[],"NodeId":16},{"id":"90","internalFlowId":"0ea43a13-cd95-4167-9ef7-63b2e217d35c","type":"quantum","selected":false,"name":"fb94f020-6d37-4667-a7b8-c54b76f6a4e1","in":true,"label":"Backspace","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":6,"clients":[],"NodeId":16},{"id":"91","internalFlowId":"85395ee6-a284-4a29-91e1-b09d3104e417","type":"quantum","selected":false,"name":"b9b8da38-b515-4447-a8b7-020e36372b45","in":true,"label":"Clear","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":7,"clients":[],"NodeId":16},{"id":"92","internalFlowId":"a7df73c6-8232-46f6-b0b6-fc951d50d02d","type":"quantum","selected":false,"name":"477cbcf0-51c4-497a-84f1-3da06e0b8cb3","in":true,"label":"Show Cursor","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":8,"clients":[],"NodeId":16},{"id":"93","internalFlowId":"1e34e64c-01db-4a0b-a8a9-beeec6f62fe1","type":"quantum","selected":false,"name":"2923738c-fb12-472a-92d3-49bd0735df78","in":true,"label":"Blink Cursor","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":9,"clients":[],"NodeId":16},{"id":"94","internalFlowId":"50fafbbb-e1fa-48a8-af38-99b42cc35da8","type":"quantum","selected":false,"name":"5b5379f4-00df-4b76-ae22-8aec086acdb1","in":true,"label":"VT-100 String","description":"Nothing added here yet.","qTrigger":true,"defaultValue":null,"properties":{"virtual":true},"signalType":{"key":"string","name":"String","baseType":"String","defaultValue":""},"index":10,"clients":[],"NodeId":16}],"category":"Display","version":"0.0.1"},{"id":"17","internalFlowId":"ac947f9b6f","type":"quantum","selected":false,"x":-447.341,"y":126.988,"name":"Distance Sensor","mappingDescription":"No instructions defined!","description":"A distance sensor, which sends out the current distance.","color":"#02B0EF","qType":"Widget","originalName":"Distance Ultrasonic","factoryId":"widget_distance_ultrasonic","properties":{"mappableCategory":{"category":5,"subCategory":1},"multiMapping":false,"manufacturer":"generic"},"ports":[{"id":"95","internalFlowId":"e5a6820c-aef6-4920-87ab-291eec10f19d","type":"quantum","selected":false,"name":"3b98695a-4bae-4d82-b3f5-95578d0ad89c","in":false,"label":"Distance","description":"Nothing added here yet.","qTrigger":null,"defaultValue":null,"properties":{"clientService":{"key":"q_distance_in","name":"Distance In","uuid":"b1a5c20e-4aac-5100-a43b-325bebdc9fdf","value_len":"6","props":["read","notify"],"propChar":[{"key":"decimal_places","title":"Decimal Places","len":1},{"key":"range","title":"Range","len":4}],"signalType":{"key":"distance","name":"Distance","baseType":"Number","defaultValue":0},"characteristics":[{"key":"q_info","name":"Info Characteristic","uuid":"6375a20d-31ae-4456-aaf6-8fc84e3cce26","properties":["read"],"type":"utf-8"},{"key":"q_value","name":"Value Characteristic","uuid":"a97ba6d9-c409-4118-8735-b5bef87b9afd","properties":["read","notify"],"type":"user"},{"key":"q_properties","name":"Prop Characteristic","uuid":"93d79faa-21ed-4ce7-b658-d9bcb06bd943","properties":["read"],"type":"utf-8"},{"key":"q_subClient","name":"Subclient Characteristic","uuid":"1270fde2-fd5e-4e4f-b866-241f105f7b15","properties":["read"],"type":"user"}],"drivers":["custom_HC_SR04"]}},"signalType":{"key":"distance","name":"Distance","baseType":"Number","defaultValue":0},"index":0,"clients":[],"NodeId":17}],"category":"Measurement","version":"0.0.1"},{"id":"18","internalFlowId":"18","type":"quantum","selected":false,"x":1517.508,"y":-38.119,"name":"Red","mappingDescription":"No instructions defined!","description":"A simple led that can just be on or off.","color":"#02B0EF","qType":"Widget","originalName":"LED","factoryId":"widget_led","properties":{"mappableCategory":{"category":5,"subCategory":1},"multiMapping":false,"manufacturer":"generic"},"ports":[{"id":"96","internalFlowId":"492a600f-ddd0-46e0-ad1e-ae032d2fe94e","type":"quantum","selected":false,"name":"49c85d75-c1f3-49c7-9bb5-6928ef20df3a","in":true,"label":"On/Off","description":"Nothing added here yet.","qTrigger":true,"defaultValue":"","properties":{"clientService":{"key":"q_digital_out","name":"Digital Out","uuid":"efc403fb-d447-5100-8f26-c6942cc3db39","value_len":"1","props":["write","read"],"propChar":[],"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"characteristics":[{"key":"q_info","name":"Info Characteristic","uuid":"6375a20d-31ae-4456-aaf6-8fc84e3cce26","properties":["read"],"type":"utf-8"},{"key":"q_value","name":"Value Characteristic","uuid":"a97ba6d9-c409-4118-8735-b5bef87b9afd","properties":["write","read"],"type":"user"},{"key":"q_properties","name":"Prop Characteristic","uuid":"93d79faa-21ed-4ce7-b658-d9bcb06bd943","properties":["read"],"type":"utf-8"},{"key":"q_subClient","name":"Subclient Characteristic","uuid":"1270fde2-fd5e-4e4f-b866-241f105f7b15","properties":["read"],"type":"user"}],"drivers":["custom_gpio_out","custom_mcp23017_out","custom_Q74HC595"]}},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":0,"clients":[],"NodeId":18}],"category":"Display","version":"0.0.1"},{"id":"19","internalFlowId":"19","type":"quantum","selected":false,"x":1522.581,"y":-161.037,"name":"Green","mappingDescription":"No instructions defined!","description":"A simple led that can just be on or off.","color":"#02B0EF","qType":"Widget","originalName":"LED","factoryId":"widget_led","properties":{"mappableCategory":{"category":5,"subCategory":1},"multiMapping":false,"manufacturer":"generic"},"ports":[{"id":"97","internalFlowId":"0cf6d818-38bf-432e-9be5-e2e54409c100","type":"quantum","selected":false,"name":"aa40d209-144c-40f7-bfea-e0655e10665c","in":true,"label":"On/Off","description":"Nothing added here yet.","qTrigger":true,"defaultValue":"","properties":{"clientService":{"key":"q_digital_out","name":"Digital Out","uuid":"efc403fb-d447-5100-8f26-c6942cc3db39","value_len":"1","props":["write","read"],"propChar":[],"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"characteristics":[{"key":"q_info","name":"Info Characteristic","uuid":"6375a20d-31ae-4456-aaf6-8fc84e3cce26","properties":["read"],"type":"utf-8"},{"key":"q_value","name":"Value Characteristic","uuid":"a97ba6d9-c409-4118-8735-b5bef87b9afd","properties":["write","read"],"type":"user"},{"key":"q_properties","name":"Prop Characteristic","uuid":"93d79faa-21ed-4ce7-b658-d9bcb06bd943","properties":["read"],"type":"utf-8"},{"key":"q_subClient","name":"Subclient Characteristic","uuid":"1270fde2-fd5e-4e4f-b866-241f105f7b15","properties":["read"],"type":"user"}],"drivers":["custom_gpio_out","custom_mcp23017_out","custom_Q74HC595"]}},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":0,"clients":[],"NodeId":19}],"category":"Display","version":"0.0.1"},{"id":"20","internalFlowId":"0890a3c305","type":"quantum","selected":false,"x":289.339,"y":25.861,"name":"Toggle Up","mappingDescription":null,"description":"Toggle switches between the two states depending on current state. Set is always True, Reset always false.","color":"#DE00BC","qType":"Snippet","originalName":"Digital TOGGLE","factoryId":"snippet_digital_toggle","properties":{"executeCode":"\nswitch (trigger) {\n  case 0:\n    context.state = true;\n    break;\n  case 1:\n    context.state = false;\n    break;\n  case 2:\n  {\n    context.state = !context.state;\n    break;\n  }\n  default:\n    break;\n}\nreturn [context.state, !context.state];\n  "},"ports":[{"id":"98","internalFlowId":"3935ee46-84ab-4489-972c-af84db11779e","type":"quantum","selected":false,"name":"82933942-7cde-476e-8625-40ded9266601","in":true,"label":"Set","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":20},{"id":"99","internalFlowId":"c0f57bac-762d-42ee-bbbc-336f45ec927a","type":"quantum","selected":false,"name":"ea52c2f5-68a1-45b3-96ca-9cd3835fd97f","in":true,"label":"Reset","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":20},{"id":"100","internalFlowId":"9f54c754-94d6-4edc-acea-5e5ab486fb0e","type":"quantum","selected":false,"name":"d1fa0409-5406-4fe2-b90f-1703cf18d5df","in":true,"label":"Toggle","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":20},{"id":"101","internalFlowId":"8dce58fa-4a93-4f06-8d86-8aef5cb18b1f","type":"quantum","selected":false,"name":"4d1ec116-8644-4a34-a2cf-c7ab10bf3327","in":false,"label":"Out","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":20},{"id":"102","internalFlowId":"099fa1b4-0279-43b3-8e5c-8e3e428936cd","type":"quantum","selected":false,"name":"fc63aa4e-7a9c-4427-99d6-178a55b0f352","in":false,"label":"Out inverted","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":4,"clients":[],"NodeId":20}],"category":"Logic","version":"0.0.1"},{"id":"21","internalFlowId":"4b4848daae","type":"quantum","selected":false,"x":284.366,"y":176.715,"name":"Toggle Down","mappingDescription":null,"description":"Toggle switches between the two states depending on current state. Set is always True, Reset always false.","color":"#DE00BC","qType":"Snippet","originalName":"Digital TOGGLE","factoryId":"snippet_digital_toggle","properties":{"executeCode":"\nswitch (trigger) {\n  case 0:\n    context.state = true;\n    break;\n  case 1:\n    context.state = false;\n    break;\n  case 2:\n  {\n    context.state = !context.state;\n    break;\n  }\n  default:\n    break;\n}\nreturn [context.state, !context.state];\n  "},"ports":[{"id":"103","internalFlowId":"591a915f-d374-4286-907b-889c8746150e","type":"quantum","selected":false,"name":"852c02ed-900b-4072-8165-e81689f0b34d","in":true,"label":"Set","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":21},{"id":"104","internalFlowId":"41988fd2-0f7b-4593-94a8-bdda9acd75a9","type":"quantum","selected":false,"name":"0da2ae75-f2a9-4ff3-9afc-51f28fb553f6","in":true,"label":"Reset","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":21},{"id":"105","internalFlowId":"92e341f6-4c8c-4684-8ffe-851bad8d327f","type":"quantum","selected":false,"name":"68a3aba6-b3a1-444d-9e55-55735e3fcd99","in":true,"label":"Toggle","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":21},{"id":"106","internalFlowId":"221a8e91-496e-46dc-8f7e-6d6787a91e6f","type":"quantum","selected":false,"name":"ae0fbf61-f6a3-4031-969b-efb4128cf126","in":false,"label":"Out","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":21},{"id":"107","internalFlowId":"cf5c2138-779e-411b-af5e-0ca8a1222835","type":"quantum","selected":false,"name":"1ee0a87c-abdd-40a5-b4d8-682fcebe3840","in":false,"label":"Out inverted","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":4,"clients":[],"NodeId":21}],"category":"Logic","version":"0.0.1"},{"id":"22","internalFlowId":"08c988d104","type":"quantum","selected":false,"x":-19.438,"y":2.145,"name":"Top","mappingDescription":null,"description":"Compare two numeric values.","color":"#DE00BC","qType":"Snippet","originalName":"Number Compare","factoryId":"snippet_number_compare","properties":{"executeCode":"\nconst val1 = parseFloat(inPorts[1].value) || 0;\nconst val2 = parseFloat(inPorts[2].value) || 0;\n\nif (val1 > val2) {\n  return [true, false, false];\n}\nif (val1 < val2) {\n  return [false, true, false];\n}\nreturn [false, false, true];\n  "},"ports":[{"id":"108","internalFlowId":"79231ac4-0a99-4930-b302-ce4c6a81789a","type":"quantum","selected":false,"name":"6bbcd3e2-1901-48ca-a6e1-36315f2e9b45","in":true,"label":"Trigger","description":null,"qTrigger":true,"defaultValue":null,"properties":{"defaultHidden":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":22},{"id":"109","internalFlowId":"383ab5cd-5bd3-48d6-afe4-b289a23808ba","type":"quantum","selected":false,"name":"af69e1ff-cfda-4ba9-a78a-73ca73f6be9b","in":true,"label":"Number 1","description":null,"qTrigger":true,"defaultValue":"0","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":1,"clients":[],"NodeId":22},{"id":"110","internalFlowId":"468cd2d9-072e-4aca-b8c6-1a11a9d10a5b","type":"quantum","selected":false,"name":"24e9189f-9ebc-485d-a98c-4ed916a04313","in":true,"label":"Number 2","description":null,"qTrigger":false,"defaultValue":"35","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":2,"clients":[],"NodeId":22},{"id":"111","internalFlowId":"c680b662-6783-4300-82e3-68c873f0a264","type":"quantum","selected":false,"name":"94a54841-ced3-4e35-9103-ee9ac135a838","in":false,"label":"Greater","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":22},{"id":"112","internalFlowId":"ecd4e379-178c-44e5-9b12-25dd6e6a6963","type":"quantum","selected":false,"name":"c0330bf4-42b6-4bdb-8af6-26f96d92287f","in":false,"label":"Less","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":4,"clients":[],"NodeId":22},{"id":"113","internalFlowId":"89ec78a7-4ec7-4ac4-b551-ad667af42056","type":"quantum","selected":false,"name":"5e6a30bb-df78-497b-9173-f35aff8b49f0","in":false,"label":"Equal","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":5,"clients":[],"NodeId":22}],"category":"Compare","version":"0.0.1"},{"id":"23","internalFlowId":"2ffe1fa88a","type":"quantum","selected":false,"x":-20.225,"y":179.62,"name":"Bottom","mappingDescription":null,"description":"Compare two numeric values.","color":"#DE00BC","qType":"Snippet","originalName":"Number Compare","factoryId":"snippet_number_compare","properties":{"executeCode":"\nconst val1 = parseFloat(inPorts[1].value) || 0;\nconst val2 = parseFloat(inPorts[2].value) || 0;\n\nif (val1 > val2) {\n  return [true, false, false];\n}\nif (val1 < val2) {\n  return [false, true, false];\n}\nreturn [false, false, true];\n  "},"ports":[{"id":"114","internalFlowId":"5bb7ba59-a471-4f8b-898d-17f028039301","type":"quantum","selected":false,"name":"8b2e0c32-9fdf-49f5-ab97-1e77d6d1c2bd","in":true,"label":"Trigger","description":null,"qTrigger":true,"defaultValue":null,"properties":{"defaultHidden":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":23},{"id":"115","internalFlowId":"5043390f-a48c-40a1-a8d3-5e3d3aeb4078","type":"quantum","selected":false,"name":"0a1508d7-96e1-4265-aefc-89990583676a","in":true,"label":"Number 1","description":null,"qTrigger":true,"defaultValue":"0","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":1,"clients":[],"NodeId":23},{"id":"116","internalFlowId":"74d76f12-4e0a-4178-8f88-5bd28b4eadd0","type":"quantum","selected":false,"name":"3a333ef9-2b69-4fbf-913b-e79062143171","in":true,"label":"Number 2","description":null,"qTrigger":false,"defaultValue":"5","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":2,"clients":[],"NodeId":23},{"id":"117","internalFlowId":"4c0c5024-58d8-4d9a-8712-f770f56b1c96","type":"quantum","selected":false,"name":"221c975d-625a-405c-a9cf-471a85e119cc","in":false,"label":"Greater","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":23},{"id":"118","internalFlowId":"0d7d697d-fdeb-4ca6-bfd3-89837c0b388e","type":"quantum","selected":false,"name":"8f8961b9-b3a2-4462-9307-b1d858bb653d","in":false,"label":"Less","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":4,"clients":[],"NodeId":23},{"id":"119","internalFlowId":"98242782-3cca-46a4-945c-c666c2f78047","type":"quantum","selected":false,"name":"321288b6-d15e-4e57-a2fd-ee9f31568ecd","in":false,"label":"Equal","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":5,"clients":[],"NodeId":23}],"category":"Compare","version":"0.0.1"},{"id":"24","internalFlowId":"24","type":"quantum","selected":false,"x":666.322,"y":84.675,"name":"AND","mappingDescription":null,"description":"A logic gate, that is true, when both inputs are true.","color":"#DE00BC","qType":"Snippet","originalName":"Digital AND","factoryId":"snippet_digital_and","properties":{"executeCode":"\nfor (let i = 1; i < inPorts.length; i += 1) {\n  if (!inPorts[i].value) {\n    return [false];\n  }\n}\nreturn [true];\n  "},"ports":[{"id":"120","internalFlowId":"47f9b319-b991-4c53-b998-7506d4864cda","type":"quantum","selected":false,"name":"dd944719-11d0-4cb4-96ec-77af33b10821","in":true,"label":"Trigger","description":null,"qTrigger":true,"defaultValue":null,"properties":{"defaultHidden":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":24},{"id":"121","internalFlowId":"7338930e-a7dc-4d79-82c9-badb0116bf81","type":"quantum","selected":false,"name":"34ba3a4e-ac06-4769-b71f-abf1e774dc8d","in":true,"label":"In 1","description":null,"qTrigger":false,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":1,"clients":[],"NodeId":24},{"id":"122","internalFlowId":"377a4ff9-276f-43b2-be65-ca0cf95a15e3","type":"quantum","selected":false,"name":"6b00ed8b-3c2d-45d6-bd87-e5f780e8c671","in":true,"label":"In 2","description":null,"qTrigger":false,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":2,"clients":[],"NodeId":24},{"id":"123","internalFlowId":"33b75b02-206d-4fe4-a12f-420981086bad","type":"quantum","selected":false,"name":"e3ad8a26-4be7-4db5-86e2-9fa3ee03ce64","in":false,"label":"Out","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":24}],"category":"Logic","version":"0.0.1"},{"id":"25","internalFlowId":"724b7c2fcd","type":"quantum","selected":false,"x":947.763,"y":-66.453,"name":"Timeout","mappingDescription":null,"description":"Add a timeout to your app. Delay is set in ms. (1000ms = 1sec)","color":"#DE00BC","qType":"Snippet","originalName":"Timeout","factoryId":"snippet_timeout","properties":{"executeCode":"\nif (!context.delay) {\n  context.delay = parseInt(inPorts[1].value, 10) || 2000;\n}\n\nswitch (trigger) {\n  case TRIGGERS.SYSTEM_SYNC:\n    return [new Date()];\n  case 0:\n    syncSleep(context.delay);\n    break;\n  case 1:\n    context.delay = inPorts[1].value;\n    break;\n  default: break;\n}\n\nreturn [];\n  "},"ports":[{"id":"124","internalFlowId":"2ac21444-fc9c-4cb4-b98a-3351bdd28e08","type":"quantum","selected":false,"name":"eec88802-f820-415e-b5ad-c39d291028ee","in":true,"label":"In","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":25},{"id":"125","internalFlowId":"2ee7ba99-a131-49fb-a96b-c52b5cf98a37","type":"quantum","selected":false,"name":"07580b82-02de-4767-af2e-46b19409ccfe","in":true,"label":"Delay (ms)","description":null,"qTrigger":true,"defaultValue":"700","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":1,"clients":[],"NodeId":25},{"id":"126","internalFlowId":"6636dd60-6046-49d1-9b72-071c749b7ed9","type":"quantum","selected":false,"name":"8b8de845-7d6e-4959-8cb3-d46c64551dec","in":false,"label":"Out","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":25}],"category":"Timing","version":"0.0.1"},{"id":"26","internalFlowId":"a7c6e2741b","type":"quantum","selected":false,"x":1217.006,"y":-86.646,"name":"Toggle LEDs","mappingDescription":null,"description":"Toggle switches between the two states depending on current state. Set is always True, Reset always false.","color":"#DE00BC","qType":"Snippet","originalName":"Digital TOGGLE","factoryId":"snippet_digital_toggle","properties":{"executeCode":"\nswitch (trigger) {\n  case 0:\n    context.state = true;\n    break;\n  case 1:\n    context.state = false;\n    break;\n  case 2:\n  {\n    context.state = !context.state;\n    break;\n  }\n  default:\n    break;\n}\nreturn [context.state, !context.state];\n  "},"ports":[{"id":"127","internalFlowId":"25db4961-b5bd-4f27-b613-7ee4ac5856ec","type":"quantum","selected":false,"name":"393aa89e-89b3-4555-9452-c45512941bb3","in":true,"label":"Set","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":26},{"id":"128","internalFlowId":"fde127d3-613d-4b21-b3b5-eff8a03677f1","type":"quantum","selected":false,"name":"9650323c-8f4a-467a-a3bb-ed49666059bd","in":true,"label":"Reset","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":26},{"id":"129","internalFlowId":"a68b6f1f-1795-4ef6-b4d7-8a60a09b2b18","type":"quantum","selected":false,"name":"99a015d3-4058-4f67-9835-fabaf497ee0b","in":true,"label":"Toggle","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":26},{"id":"130","internalFlowId":"dd8b71ed-30f9-441b-a6f3-fb589c9727bc","type":"quantum","selected":false,"name":"06396f8e-fab7-496e-bec0-fcbc2a961919","in":false,"label":"Out","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":3,"clients":[],"NodeId":26},{"id":"131","internalFlowId":"56568baa-8f70-4e7e-9db2-1e2654c34f83","type":"quantum","selected":false,"name":"a044f50d-9e06-40da-b3ab-70497e80d3f8","in":false,"label":"Out inverted","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false},"index":4,"clients":[],"NodeId":26}],"category":"Logic","version":"0.0.1"},{"id":"27","internalFlowId":"4107f6e255","type":"quantum","selected":false,"x":1151.072,"y":218.216,"name":"Data Counter","mappingDescription":null,"description":"Increment and decrement a defined counter.","color":"#DE00BC","qType":"Snippet","originalName":"Data Counter","factoryId":"snippet_data_counter","properties":{"executeCode":"\nif (context.min === undefined) {\n  context.min = parseInt(inPorts[3].value, 10) || 0;\n}\n\nif (context.max === undefined) {\n  context.max = parseInt(inPorts[4].value, 10) || 100;\n}\n\nif (context.value === undefined) {\n  context.value = parseInt(inPorts[2].value, 10) || context.min;\n}\n\nswitch (trigger) {\n  case 0:\n    if (context.value < context.max && context.value >= context.min) {\n      context.value += 1;\n      return [context.value];\n    }\n    // When value is out of scope return maximum\n    return [context.max];\n  case 1:\n    if (context.value > context.min && context.value <= context.max) {\n      context.value -= 1;\n      return [context.value];\n    }\n    // When value is out of scope return minimum\n    return [context.min];\n  case 2:\n    if (inPorts[2].value < context.min) {\n      context.value = context.min;\n    } else if (inPorts[2].value > context.max) {\n      context.value = context.max;\n    } else {\n      context.value = inPorts[2].value;\n    }\n    editInPort(2, {});\n    return [context.value];\n  case 3:\n    context.min = inPorts[3].value;\n    break;\n  case 4:\n    context.max = inPorts[4].value;\n    break;\n  default: break;\n}\nreturn [];\n  "},"ports":[{"id":"132","internalFlowId":"335233f4-6544-4b5f-937d-4d73838dc00d","type":"quantum","selected":false,"name":"7f256472-909d-4bbc-9530-446b831f72c3","in":true,"label":"Increment","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":27},{"id":"133","internalFlowId":"1f53f1bd-a9e6-42be-a686-36523d72ed51","type":"quantum","selected":false,"name":"c5276fe7-6e67-4e89-a528-926dde83912a","in":true,"label":"Decrement","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":27},{"id":"134","internalFlowId":"37e3ac83-6c72-471c-9989-cc163c6022f2","type":"quantum","selected":false,"name":"ecdecb06-134b-4f45-9632-13226d1cd429","in":true,"label":"Value","description":null,"qTrigger":true,"defaultValue":"","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":2,"clients":[],"NodeId":27},{"id":"135","internalFlowId":"96c9f0df-5d62-4656-a05f-2f3baed52a09","type":"quantum","selected":false,"name":"14ba4ebd-f09f-4030-962f-8e3c133b39fe","in":true,"label":"Min","description":null,"qTrigger":true,"defaultValue":"0","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":3,"clients":[],"NodeId":27},{"id":"136","internalFlowId":"5e8c044a-8df3-40af-8a31-b1853721488e","type":"quantum","selected":false,"name":"5ef949d9-f842-4f43-984a-f12d399a66fb","in":true,"label":"Max","description":null,"qTrigger":true,"defaultValue":"100","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":4,"clients":[],"NodeId":27},{"id":"137","internalFlowId":"fd439990-ecde-46fd-8956-b17d1d77e047","type":"quantum","selected":false,"name":"000ed5b7-c766-439b-b765-bd700950f61c","in":false,"label":"Value","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":5,"clients":[],"NodeId":27}],"category":"Data","version":"0.0.1"},{"id":"28","internalFlowId":"ea18f48ac4","type":"quantum","selected":false,"x":1148.886,"y":430.237,"name":"Static Number","mappingDescription":null,"description":"Set a static number that can be triggered, when needed.","color":"#DE00BC","qType":"Snippet","originalName":"Static Number","factoryId":"snippet_static_number","properties":{"executeCode":"\nreturn [parseFloat(inPorts[1].value) || 0];\n  "},"ports":[{"id":"138","internalFlowId":"52148ddf-74ac-4332-838c-1167c0449f7a","type":"quantum","selected":false,"name":"5f889289-5e4b-4b9d-bead-19ba64a994a9","in":true,"label":"Trigger","description":null,"qTrigger":true,"defaultValue":null,"properties":{"defaultHidden":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":28},{"id":"139","internalFlowId":"a11c29f6-2e20-47d1-bd51-35f48a0dec88","type":"quantum","selected":false,"name":"337e5dba-5173-4b65-9d30-3b8571acc90a","in":true,"label":"Value","description":null,"qTrigger":false,"defaultValue":"","properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":1,"clients":[],"NodeId":28},{"id":"140","internalFlowId":"02c35ff5-b994-46d9-9e53-c0c3bc202eb8","type":"quantum","selected":false,"name":"2a5c2a73-d9fd-411d-a5a0-86d04923501f","in":false,"label":"Value","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":2,"clients":[],"NodeId":28}],"category":"Data","version":"0.0.1"},{"id":"29","internalFlowId":"872a3cbd0f","type":"quantum","selected":false,"x":378.64,"y":602.569,"name":"Initial Trigger","mappingDescription":null,"description":"Triggers at the start of an application.","color":"#DE00BC","qType":"Snippet","originalName":"Initial Trigger","factoryId":"snippet_initial_trigger","properties":{"manufacturer":"qinitial","executeCode":"\nreturn [new Date()];\n  "},"ports":[{"id":"141","internalFlowId":"b27454f3-2eea-4aad-8b16-9abe4a3cdebe","type":"quantum","selected":false,"name":"ef34e731-ecf8-4c85-aab7-503c9712a1ec","in":false,"label":"Trigger","description":null,"qTrigger":null,"defaultValue":"","properties":{},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":29}],"category":"Timing","version":"0.0.1"},{"id":"30","internalFlowId":"f3f332b5ea","type":"quantum","selected":false,"x":654.458,"y":600.94,"name":"Pushup Count:","mappingDescription":null,"description":"Set a static String that can be triggered, when needed.","color":"#DE00BC","qType":"Snippet","originalName":"Static String","factoryId":"snippet_static_string","properties":{"executeCode":"\nreturn [inPorts[1].value || ''];\n  "},"ports":[{"id":"142","internalFlowId":"f7a295aa-6abd-499f-96d0-a05dc8f5df11","type":"quantum","selected":false,"name":"01b00d22-d0d1-4e34-aded-466f1674fb27","in":true,"label":"Trigger","description":null,"qTrigger":true,"defaultValue":null,"properties":{"defaultHidden":true},"signalType":{"key":"trigger","name":"Trigger","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":30},{"id":"143","internalFlowId":"b779ae6b-ce9c-4825-877d-ef5c599b1fc4","type":"quantum","selected":false,"name":"e1ba7c6b-03e7-4315-be2d-8c5eca4149f4","in":true,"label":"String","description":null,"qTrigger":false,"defaultValue":"","properties":{},"signalType":{"key":"string","name":"String","baseType":"String","defaultValue":""},"index":1,"clients":[],"NodeId":30},{"id":"144","internalFlowId":"0b0b7653-4796-4f65-bd06-ae5157245a9b","type":"quantum","selected":false,"name":"65a312fe-0c57-48a3-9379-8ab4bc0881e2","in":false,"label":"String","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"string","name":"String","baseType":"String","defaultValue":""},"index":2,"clients":[],"NodeId":30}],"category":"Data","version":"0.0.1"},{"id":"31","internalFlowId":"9c21aca67f","type":"quantum","selected":false,"x":-466.585,"y":-68.443,"name":"Untitled","mappingDescription":null,"description":"Input number field to enter a numeric value on the dashboard.","color":"#07D174","qType":"Gadget","originalName":"Input Number","factoryId":"gadget_input_number","properties":{"gadgetType":{"name":"Inputnumber"},"gadgetLabel":"Input Number","gadgetColor":"info","gadgetGroup":"1","gadgetIcon":"buttonIcon"},"ports":[{"id":"145","internalFlowId":"4044d631-93ec-4528-85b1-2dec98e2c3af","type":"quantum","selected":false,"name":"6bf4a65e-db43-44c5-a5cf-5425f2e3b4d4","in":true,"label":"Label","description":null,"qTrigger":true,"defaultValue":null,"properties":{},"signalType":{"key":"string","name":"String","baseType":"String","defaultValue":""},"index":0,"clients":[],"NodeId":31},{"id":"146","internalFlowId":"424afd25-6b69-4053-94c8-8c69024d1208","type":"quantum","selected":false,"name":"9490b871-2d73-498f-9147-267234e82943","in":true,"label":"Number","description":null,"qTrigger":true,"defaultValue":null,"properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":1,"clients":[],"NodeId":31},{"id":"147","internalFlowId":"1d580922-d10f-4c9d-8934-142406f0ddaa","type":"quantum","selected":false,"name":"c5c0f7dd-20f2-4470-93f6-90dd085d31b9","in":false,"label":"Number","description":null,"qTrigger":null,"defaultValue":null,"properties":{},"signalType":{"key":"number","name":"Number","baseType":"Number","defaultValue":0},"index":2,"clients":[],"NodeId":31}],"category":"Input","version":"0.0.1"}],"status":"Stopped","rendering":{"id":"10","tabs":[{"id":"10","internalFlowId":"9","name":"Tab 1","position":0,"groups":[{"id":"11","internalFlowId":"10","name":"Group 1","position":0,"gadgets":[{"id":"4","NodeId":31,"GadgetGroupId":11,"position":0}]}]}]},"createdAt":"2021-03-25T17:48:59.186Z","errorLog":null,"debugFlag":false,"version":"0.0.1"}

Pushup Counter Firmware.json

JSON
{"name":"Pushup Counter","commit":"1.2.6-development-e481429c","lifecycle":false,"signal":[{"disabled":false,"subClientIndex":0,"subClientName":"Green","subClientCategory":5,"subClientSubCategory":1,"serviceName":"On/Off","service":"q_digital_out","driver":"custom_gpio_out","driverValues":{"port":"gpioPortD","pin":"13","mode":0},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false}},{"disabled":false,"subClientIndex":1,"subClientName":"Red","subClientCategory":5,"subClientSubCategory":1,"serviceName":"On/Off","service":"q_digital_out","driver":"custom_gpio_out","driverValues":{"port":"gpioPortD","pin":"14","mode":0},"signalType":{"key":"digital","name":"Digital","baseType":"Boolean","defaultValue":false}},{"disabled":false,"subClientIndex":3,"subClientName":"Distance Sensor","subClientCategory":3,"subClientSubCategory":1,"serviceName":"Distance","service":"q_distance_in","driver":"custom_HC_SR04","driverValues":{"granularity":5,"echoPort":"gpioPortD","echoPin":"15","triggerPort":"gpioPortB","triggerPin":"11"},"signalType":{"key":"distance","name":"Distance","baseType":"Number","defaultValue":0}},{"disabled":false,"subClientIndex":4,"subClientName":"LCD","subClientCategory":5,"subClientSubCategory":5,"serviceName":"Display Signal","service":"q_display","driver":"custom_LCD2004","driverValues":{"address":"27","layout":"0"},"signalType":{"key":"display","name":"Display","baseType":"JSON","internal":true,"defaultValue":{}}}],"version":"0.0.1"}

Credits

Comments