forked from blechdom/node-red-flows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Robot_Arm_Control_with_midi_v3.json
1 lines (1 loc) · 20.9 KB
/
Robot_Arm_Control_with_midi_v3.json
1
[{"id":"8057dd4e.5292b","type":"function","z":"ece5114f.f98d3","name":"MIDI KNOB PARSE","func":"var knob_array = [];\nknob_array = msg.payload;\nvar output_array = [];\n\nswitch (knob_array[0]) {\n case 48:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[0] = {payload: scaled_value};\n break;\n case 49:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[1] = {payload: scaled_value};\n break;\n case 50:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[2] = {payload: scaled_value};\n break;\n case 51:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[3] = {payload: scaled_value};\n break;\n case 52:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[4] = {payload: scaled_value};\n break;\n case 53:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[5] = {payload: scaled_value};\n break;\n case 54:\n var scaled_value = Math.floor((knob_array[1]*1000)/127);\n output_array[6] = {payload: scaled_value};\n break;\n case 55:\n var scaled_value = Math.floor((knob_array[1]*3000)/127);\n output_array[7] = {payload: scaled_value};\n break;\n \n}\nreturn output_array;\n\n\n","outputs":8,"noerr":0,"x":850,"y":780,"wires":[["f21f7edc.10c73"],["4c747024.b0025"],["b032d331.82bdb"],["ce1ca526.3bc718"],["be013137.65301"],["85a695c8.982468"],[],["fed8df65.262fb"]]},{"id":"8cb98ac2.ab62b8","type":"ui_template","z":"ece5114f.f98d3","group":"7684373e.2d7528","name":"DMX LOG","order":1,"width":"6","height":"12","format":"<ul>\n <li ng-repeat=\"x in msg.payload\">\n <font color=\"red\">{{x.topic}}</font>\n <ul>\n <li>{{x.payload}}</li>\n </ul>\n </li>\n</ul>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1510,"y":140,"wires":[[]]},{"id":"29f7d378.46406c","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo2","label":"Servo 2","group":"2155d439.dcbbbc","order":2,"width":"0","height":"0","passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":460,"wires":[["4c747024.b0025"]]},{"id":"e2d8677e.8ef1e8","type":"ui_slider","z":"ece5114f.f98d3","name":"Preset Recall Speed","label":"Robot Speed","group":"c5fa9952.1e9728","order":7,"width":0,"height":0,"passthru":true,"topic":"Slider","min":"500","max":"3000","step":1,"x":1120,"y":660,"wires":[["fed8df65.262fb","4df52d65.8ab5b4"]]},{"id":"efd01e8f.f6508","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo6","label":"Servo 6","group":"2155d439.dcbbbc","order":6,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":620,"wires":[["85a695c8.982468"]]},{"id":"b89cb8e6.255de8","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo5","label":"Servo 5","group":"2155d439.dcbbbc","order":5,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":580,"wires":[["be013137.65301"]]},{"id":"5923a2d5.faf44c","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo4","label":"Servo 4","group":"2155d439.dcbbbc","order":4,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":540,"wires":[["ce1ca526.3bc718"]]},{"id":"b4745426.bfb118","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo3","label":"Servo 3","group":"2155d439.dcbbbc","order":3,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":500,"wires":[["b032d331.82bdb"]]},{"id":"f21f7edc.10c73","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos1","rules":[{"t":"set","p":"servos_preset[0]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":420,"wires":[[]]},{"id":"4c747024.b0025","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos2","rules":[{"t":"set","p":"servos_preset[1]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":460,"wires":[[]]},{"id":"b032d331.82bdb","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos3","rules":[{"t":"set","p":"servos_preset[2]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":500,"wires":[[]]},{"id":"ce1ca526.3bc718","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos4","rules":[{"t":"set","p":"servos_preset[3]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":540,"wires":[[]]},{"id":"be013137.65301","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos5","rules":[{"t":"set","p":"servos_preset[4]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":580,"wires":[[]]},{"id":"85a695c8.982468","type":"change","z":"ece5114f.f98d3","name":"save to Global Servos6","rules":[{"t":"set","p":"servos_preset[5]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":620,"wires":[[]]},{"id":"fed8df65.262fb","type":"change","z":"ece5114f.f98d3","name":"save to Global RobotSpeed","rules":[{"t":"set","p":"robot_speed","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":660,"wires":[[]]},{"id":"b0bb0f84.48852","type":"function","z":"ece5114f.f98d3","name":"Just get preset","func":"var servos = msg.payload.payload;\nvar last_servos = global.get(\"last_sent_servos\");\nvar robot_speed = global.get(\"robot_speed\");\nvar sameness_flag = 0;\nvar m = [];\nvar servo_command = \"\";\n\nfor(var i=0; i<servos.length; i++) {\n if(servos[i]!=last_servos[i]){\n sameness_flag=1;\n }\n}\n\nif(sameness_flag==1){\n \n m[0] = { payload: \"reset\"};\n \n for (var i=1;i<7;i++)\n {\n m[i] = { payload: servos[i-1] };\n \n var id = i;\n servo_command = servo_command + id + \":\" + servos[i-1] + \":\" + robot_speed;\n if (id == 6) {\n servo_command = servo_command + \"!\";\n }\n else {\n servo_command = servo_command + \"&\";\n }\n }\n \n m[7] = { payload: servo_command };\n global.set(\"last_sent_servos\", servos);\n global.set(\"servos_preset\", servos);\n\n return m;\n\n}\n","outputs":8,"noerr":0,"x":840,"y":480,"wires":[["6dffc45.981fb3c"],["b9497504.9fd0b8"],["29f7d378.46406c"],["b4745426.bfb118"],["5923a2d5.faf44c"],["b89cb8e6.255de8"],["efd01e8f.f6508"],["d9e6157.7412ce8","d765ca02.1c0618"]]},{"id":"40e19d1b.32a294","type":"function","z":"ece5114f.f98d3","name":"insert preset","func":"var preset = [];\npreset = global.get(\"servos_preset\");\nvar newMsg = {};\nnewMsg.collection = 'servos_presets';\nnewMsg.payload = [\n {topic: msg.payload},\n {\n \"$set\": {\n \"payload\": preset\n }\n },\n {upsert:true}\n];\n\nreturn newMsg;\n","outputs":1,"noerr":0,"x":375,"y":101.5,"wires":[["ab300dcb.64299"]]},{"id":"ab300dcb.64299","type":"mongodb2 in","z":"ece5114f.f98d3","service":"_ext_","configNode":"10b19456.f31fac","name":"Store Data into MongoDB","collection":"robot_arm_presets","operation":"findOneAndUpdate","x":586,"y":102.5,"wires":[["2388558e.9160ca","d9e6157.7412ce8"]]},{"id":"fa480659.84cc38","type":"function","z":"ece5114f.f98d3","name":"init global variables","func":"global.set(\"servos_preset\",[0,0,0,0,0,0]); \nmsg.payload = global.get(\"servos_preset\");\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":520,"wires":[["8651f8c5.9a6e08","d75ff758.b0be88"]]},{"id":"19024a8d.2e6225","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":150,"y":520,"wires":[["fa480659.84cc38"]]},{"id":"8651f8c5.9a6e08","type":"debug","z":"ece5114f.f98d3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":610,"y":520,"wires":[]},{"id":"f6babd10.963bb","type":"debug","z":"ece5114f.f98d3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":610,"y":600,"wires":[]},{"id":"a31d531.659f5b","type":"function","z":"ece5114f.f98d3","name":"check global preset","func":"msg.payload = global.get(\"servos_preset\");\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":600,"wires":[["f6babd10.963bb","d75ff758.b0be88"]]},{"id":"715bf332.70cb8c","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":600,"wires":[["a31d531.659f5b"]]},{"id":"d9e6157.7412ce8","type":"function","z":"ece5114f.f98d3","name":"DASHBOARD FORMATTING","func":"var dashboardLog = context.get('dashboardLog')|| [];\n\ndashboardLog.push(msg);\nif (dashboardLog.length > 20){\n // Supprime le plus anciens message si > 20\n // Delete oldest message if > 20\n dashboardLog.shift();\n dashboardLog.length = 20;\n} \n\n// Enregistre les messages du dashboard pour le prochain affichage\n// store the value back\ncontext.set('dashboardLog',dashboardLog);\n\n// Affiche le journal des messages\n// make it part of the outgoing msg object\nmsg = {};\nmsg.payload = dashboardLog;\nreturn msg;\n","outputs":1,"noerr":0,"x":1290,"y":140,"wires":[["8cb98ac2.ab62b8"]]},{"id":"b9497504.9fd0b8","type":"ui_slider","z":"ece5114f.f98d3","name":"Servo1","label":"Servo 1","group":"2155d439.dcbbbc","order":1,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"1000","step":"10","x":1080,"y":420,"wires":[["f21f7edc.10c73"]]},{"id":"9c31dfe4.09d1f","type":"mongodb2 in","z":"ece5114f.f98d3","service":"_ext_","configNode":"10b19456.f31fac","name":"Mongo DB dynamic operation","collection":"robot_arm_presets","operation":"","x":496,"y":222.5,"wires":[["cf8b0c86.cf3a9"]]},{"id":"2388558e.9160ca","type":"function","z":"ece5114f.f98d3","name":"findOne","func":"var newMsg = {};\nnewMsg.operation = 'find.toArray';\nnewMsg.payload = {};\nreturn newMsg;","outputs":1,"noerr":0,"x":262,"y":219.5,"wires":[["9c31dfe4.09d1f"]]},{"id":"a92dad41.f6b89","type":"ui_dropdown","z":"ece5114f.f98d3","name":"Recall Pulldown","label":"Recall","place":"Select option","group":"c5fa9952.1e9728","order":2,"width":0,"height":0,"passthru":false,"options":[],"payload":"","topic":"","x":1020,"y":220,"wires":[["b0bb0f84.48852","d9e6157.7412ce8","d52ddfec.ece32"]]},{"id":"cf8b0c86.cf3a9","type":"function","z":"ece5114f.f98d3","name":"Format Preset Pulldown","func":"var msg_array = [];\nfor (var i=0; i< msg.payload.length; i++)\n{\n var tmp_object = {};\n var msg_object = msg.payload[i];\n if (msg_object.topic != undefined){\n tmp_object[msg_object.topic] = {\"topic\": msg_object.topic, \"payload\": msg_object.payload};\n msg_array[i] = tmp_object;\n }\n}\nmsg.options = msg_array;\nreturn msg;","outputs":1,"noerr":0,"x":778,"y":222,"wires":[["a92dad41.f6b89"]]},{"id":"23ca2c05.85c764","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":113,"y":218,"wires":[["2388558e.9160ca"]]},{"id":"bd792b28.ce0ba8","type":"ui_text_input","z":"ece5114f.f98d3","name":"","label":"Edit Preset Name","group":"c5fa9952.1e9728","order":4,"width":0,"height":0,"passthru":true,"mode":"text","delay":"300","topic":"","x":1430,"y":220,"wires":[["c8543762.61da28"]]},{"id":"d4e92eac.6cb81","type":"ui_button","z":"ece5114f.f98d3","name":"Save","group":"c5fa9952.1e9728","order":5,"width":0,"height":0,"passthru":false,"label":"Save Preset","color":"#FFF","bgcolor":"#FF0000","icon":"","payload":"","payloadType":"date","topic":"","x":55,"y":100,"wires":[["e259be7c.d5782"]]},{"id":"c8543762.61da28","type":"function","z":"ece5114f.f98d3","name":"set global preset name","func":"global.set(\"robot_arm_preset_name\", msg.payload);","outputs":1,"noerr":0,"x":1640,"y":220,"wires":[[]]},{"id":"e259be7c.d5782","type":"function","z":"ece5114f.f98d3","name":"save preset","func":"msg.payload = global.get(\"robot_arm_preset_name\");\nreturn msg;","outputs":1,"noerr":0,"x":207,"y":100.5,"wires":[["40e19d1b.32a294"]]},{"id":"d52ddfec.ece32","type":"function","z":"ece5114f.f98d3","name":"get preset name","func":"msg.payload = msg.payload.topic;\nreturn msg;","outputs":1,"noerr":0,"x":1240,"y":220,"wires":[["bd792b28.ce0ba8"]]},{"id":"7516b104.4a4e5","type":"ui_text","z":"ece5114f.f98d3","group":"c5fa9952.1e9728","order":3,"width":0,"height":0,"name":"","label":"SAVE PRESET","format":"{{msg.payload}}","layout":"row-left","x":100,"y":320,"wires":[]},{"id":"2fd63b1c.632f74","type":"ui_text","z":"ece5114f.f98d3","group":"c5fa9952.1e9728","order":1,"width":0,"height":0,"name":"","label":"RECALL PRESET","format":"{{msg.payload}}","layout":"row-left","x":110,"y":280,"wires":[]},{"id":"df45522d.0782a","type":"function","z":"ece5114f.f98d3","name":"delete preset","func":"var newMsg = {};\nnewMsg.operation = 'deleteOne';\nnewMsg.payload = {'topic' : msg.payload};\nreturn newMsg;","outputs":1,"noerr":0,"x":376,"y":160.5,"wires":[["4a51c8d7.f1e348"]]},{"id":"4a51c8d7.f1e348","type":"mongodb2 in","z":"ece5114f.f98d3","service":"_ext_","configNode":"10b19456.f31fac","name":"Store Data into MongoDB","collection":"robot_arm_presets","operation":"","x":587,"y":161.5,"wires":[["2388558e.9160ca","d9e6157.7412ce8"]]},{"id":"79f775e6.ec17fc","type":"ui_button","z":"ece5114f.f98d3","name":"Delete","group":"c5fa9952.1e9728","order":5,"width":0,"height":0,"passthru":false,"label":"Delete Preset","color":"#FFF","bgcolor":"#FF00FF","icon":"","payload":"","payloadType":"date","topic":"","x":56,"y":159,"wires":[["34468e11.561712"]]},{"id":"34468e11.561712","type":"function","z":"ece5114f.f98d3","name":"delete preset","func":"msg.payload = global.get(\"robot_arm_preset_name\");\nreturn msg;","outputs":1,"noerr":0,"x":208,"y":159.5,"wires":[["df45522d.0782a"]]},{"id":"dc3a2a42.2c0528","type":"serial out","z":"ece5114f.f98d3","name":"","serial":"69b521b4.6f6ec","x":2210,"y":800,"wires":[]},{"id":"9afe0b98.6b2e78","type":"serial in","z":"ece5114f.f98d3","name":"","serial":"69b521b4.6f6ec","x":130,"y":740,"wires":[["a8d77aaa.5321a8"]]},{"id":"a8d77aaa.5321a8","type":"debug","z":"ece5114f.f98d3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":740,"wires":[]},{"id":"718b38fb.209948","type":"function","z":"ece5114f.f98d3","name":"send servo data","func":"var servos = global.get(\"servos_preset\");\nvar last_servos = global.get(\"last_sent_servos\");\nvar sameness_flag = false;\nvar m = [];\n\nfor(var i=0; i<servos.length; i++) {\n if(servos[i]!=last_servos[i]){\n sameness_flag= true;\n }\n}\n\nif(sameness_flag){\n \n var robot_speed = 150;\n\n var servo_string = \"1:\" + servos[0] + \":\" + robot_speed + \"&\" +\n \"2:\" + servos[1] + \":\" + robot_speed + \"&\" +\n \"3:\" + servos[2] + \":\" + robot_speed + \"&\" +\n \"4:\" + servos[3] + \":\" + robot_speed + \"&\" +\n \"5:\" + servos[4] + \":\" + robot_speed + \"&\" +\n \"6:\" + servos[5] + \":\" + robot_speed + \"!\";\n \n m[0] = { payload: servo_string };\n m[1] = { payload: servos};\n return m;\n}\n\n","outputs":2,"noerr":0,"x":1900,"y":820,"wires":[[],[]]},{"id":"4fefe3f2.8d13fc","type":"ui_button","z":"ece5114f.f98d3","name":"RESET SERVO POSITIONS","group":"c5fa9952.1e9728","order":0,"width":0,"height":0,"passthru":false,"label":"RESET SERVO POSITIONS","color":"","bgcolor":"","icon":"","payload":"1:500:1000&2:500:1000&3:500:1000&4:500:1000&5:500:1000&6:500:1000!","payloadType":"str","topic":"","x":140,"y":360,"wires":[["c9db2466.9bed58"]]},{"id":"c9db2466.9bed58","type":"function","z":"ece5114f.f98d3","name":"load reset","func":"msg.payload = { payload : [500,500,500,500,500,500] };\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":380,"wires":[["b0bb0f84.48852"]]},{"id":"7e960ff4.ba7ac","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"1000","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":930,"y":680,"wires":[["e2d8677e.8ef1e8"]]},{"id":"6433c80f.18d3f8","type":"midi in","z":"ece5114f.f98d3","name":"AKAI APC KEY25 MIDI IN","midiport":"0","x":610,"y":780,"wires":[["8057dd4e.5292b"]]},{"id":"6dffc45.981fb3c","type":"trigger","z":"ece5114f.f98d3","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-1500","extend":false,"units":"ms","reset":"reset","bytopic":"all","name":"","x":1520,"y":860,"wires":[["2ce193ec.720bcc"]]},{"id":"3cc4256b.b4fe4a","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1310,"y":840,"wires":[["6dffc45.981fb3c"]]},{"id":"4df52d65.8ab5b4","type":"ui_numeric","z":"ece5114f.f98d3","name":"preset recall speed","label":"numeric","group":"2155d439.dcbbbc","order":0,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"1000","step":1,"x":1430,"y":720,"wires":[[]]},{"id":"7910b4eb.d7b53c","type":"function","z":"ece5114f.f98d3","name":"save last sent servos","func":"global.set(\"last_sent_servos\", [0,0,0,0,0,0]);\nreturn msg;","outputs":1,"noerr":0,"x":2000,"y":660,"wires":[[]]},{"id":"35fb5db6.a3bca2","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":1810,"y":660,"wires":[["7910b4eb.d7b53c"]]},{"id":"d75ff758.b0be88","type":"function","z":"ece5114f.f98d3","name":"Reset from global","func":"var preset = [];\nvar m = [];\npreset = global.get(\"servos_preset\");\n\n\nfor (var i=0;i<7;i++)\n{\n m[i] = { payload: preset[i] };\n}\nreturn m;\n","outputs":6,"noerr":0,"x":850,"y":600,"wires":[["b9497504.9fd0b8"],["29f7d378.46406c"],["b4745426.bfb118"],["5923a2d5.faf44c"],["b89cb8e6.255de8"],["efd01e8f.f6508"]]},{"id":"934141cf.30855","type":"inject","z":"ece5114f.f98d3","name":"RESET SERVO POSITIONS","topic":"","payload":"1:500:1000&2:500:1000&3:500:1000&4:500:1000&5:500:1000&6:500:1000!","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":400,"wires":[["c9db2466.9bed58"]]},{"id":"c00e25fc.379058","type":"inject","z":"ece5114f.f98d3","name":"reset","topic":"","payload":"reset","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1310,"y":880,"wires":[["6dffc45.981fb3c"]]},{"id":"5ab8f87e.5de808","type":"function","z":"ece5114f.f98d3","name":"get last sent","func":"msg.payload = global.get(\"last_sent_servos\");\n\nreturn msg;","outputs":1,"noerr":0,"x":1970,"y":340,"wires":[["d765ca02.1c0618"]]},{"id":"81ae1d3f.d477a","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1800,"y":340,"wires":[["5ab8f87e.5de808"]]},{"id":"1915341c.94df8c","type":"function","z":"ece5114f.f98d3","name":"get current","func":"msg.payload = global.get(\"servos_preset\");\nreturn msg;","outputs":1,"noerr":0,"x":1970,"y":400,"wires":[["d765ca02.1c0618"]]},{"id":"ecba78f0.ac8c78","type":"inject","z":"ece5114f.f98d3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1800,"y":400,"wires":[["1915341c.94df8c"]]},{"id":"d765ca02.1c0618","type":"debug","z":"ece5114f.f98d3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2230,"y":520,"wires":[]},{"id":"95163c07.9a5cc","type":"function","z":"ece5114f.f98d3","name":"save last sent","func":"global.set(\"last_sent_servos\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":2120,"y":880,"wires":[[]]},{"id":"d988758a.787898","type":"debug","z":"ece5114f.f98d3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2170,"y":1040,"wires":[]},{"id":"2ce193ec.720bcc","type":"function","z":"ece5114f.f98d3","name":"get last sent","func":"msg.payload = { last_sent_servos: global.get(\"last_sent_servos\"),\n current_servos: global.get(\"servos_preset\")\n \n};\n\nreturn msg;","outputs":1,"noerr":0,"x":1750,"y":880,"wires":[["d988758a.787898"]]},{"id":"7684373e.2d7528","type":"ui_group","z":"ece5114f.f98d3","name":"SERVO LOG","tab":"a232f4ae.722488","order":4,"disp":true,"width":"6","collapse":true},{"id":"2155d439.dcbbbc","type":"ui_group","z":"","name":"SERVO SLIDERS","tab":"a232f4ae.722488","order":3,"disp":true,"width":"6","collapse":false},{"id":"c5fa9952.1e9728","type":"ui_group","z":"","name":"PRESETS","tab":"a232f4ae.722488","order":2,"disp":true,"width":"6","collapse":false},{"id":"10b19456.f31fac","type":"mongodb2","z":"","uri":"mongodb://127.0.0.1:27017/cinebrain","name":"cinebrain db","options":"","parallelism":"-1"},{"id":"69b521b4.6f6ec","type":"serial-port","z":"","serialport":"COM5","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"a232f4ae.722488","type":"ui_tab","z":"","name":"ROBOT ARM DASHBOARD","icon":"home","order":2}]