{ "workspace": { "blocks": { "languageVersion": 0, "blocks": [ { "type": "main_program", "id": "COLVqmFP{j*XNMc.9rz+", "x": -50, "y": -30, "inputs": { "BODY": { "block": { "type": "controls_whileUntil", "id": "$uyZgjkMX%3!oZkaV{:v", "fields": { "MODE": "WHILE" }, "inputs": { "BOOL": { "block": { "type": "logic_compare", "id": ".qR|JeS~%Aq7^G/.FC5$", "fields": { "OP": "NEQ" }, "inputs": { "A": { "block": { "type": "hmiGetButton", "id": "$IXubt[ys3S3jc`.w5F0", "fields": { "NAME": "Btn1" } } }, "B": { "block": { "type": "logic_boolean", "id": ")Uq|v]]Tho:rGgn1ik{H", "fields": { "BOOL": "TRUE" } } } } } }, "DO": { "block": { "type": "delay", "id": "CY3QgWQ(jalnV(6VA:.w", "fields": { "DURATION_MS": 500 } } } }, "next": { "block": { "type": "controls_whileUntil", "id": "qWwrS*25QaeI4eIwq+~%", "fields": { "MODE": "WHILE" }, "inputs": { "BOOL": { "block": { "type": "logic_boolean", "id": "iL:?Vnm{E8Pa6(SX-nEl", "fields": { "BOOL": "TRUE" } } }, "DO": { "block": { "type": "variables_set", "id": "vCG[_})zpGPcSQBid!Yj", "fields": { "VAR": { "id": "C_:{ED@bJimgLzEmC6(`" } }, "inputs": { "VALUE": { "block": { "type": "math_number", "id": "!uHp`,,`q_M2%HMnG0@[", "fields": { "NUM": 0 } } } }, "next": { "block": { "type": "variables_set", "id": "qzDOA-}@MU,]iqj`er}D", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } }, "inputs": { "VALUE": { "block": { "type": "math_number", "id": "39KE0jn61fTR1Qp4)d57", "fields": { "NUM": 500 } } } }, "next": { "block": { "type": "digitalOut", "id": "Cz1MB5`}~cPRiZhh$/P9", "fields": { "GPIO": 17 }, "inputs": { "digitalOut": { "block": { "type": "procedures_callreturn", "id": "U|7!ynVp5Z.nwD_`4=Z,", "extraState": { "name": "foo", "params": [ "logic" ] }, "inputs": { "ARG0": { "block": { "type": "logic_boolean", "id": "HXRaHRaPE)[G3WGmOi-T", "fields": { "BOOL": "TRUE" } } } } } } }, "next": { "block": { "type": "variables_set", "id": "5WG|J40M0!L^mM5x_2@N", "fields": { "VAR": { "id": "xjE5n-FetBK*,)qj?pyn" } }, "inputs": { "VALUE": { "block": { "type": "text", "id": "^ZnZat6;hW,I`H7H15^^", "fields": { "TEXT": "cek" } } } }, "next": { "block": { "type": "print", "id": "#iq/$E*oB0V`%5O}O+2!", "inputs": { "TEXT": { "block": { "type": "variables_get", "id": "4[hYi)09%}I%Pj4}fhdb", "fields": { "VAR": { "id": "xjE5n-FetBK*,)qj?pyn" } } } } }, "next": { "block": { "type": "delay", "id": "IXp?_lac7+V*GG!lW{]0", "fields": { "DURATION_MS": 1000 }, "next": { "block": { "type": "variables_set", "id": "1@OTYSIBwU0xvg(2?-y;", "fields": { "VAR": { "id": "C_:{ED@bJimgLzEmC6(`" } }, "inputs": { "VALUE": { "block": { "type": "digitalIn", "id": "DJpFh.6H~L9fX2V4SDJd", "fields": { "GPIO": 16 } } } }, "next": { "block": { "type": "variables_set", "id": "7v:u)fVh$GAwIhdwtH-i", "fields": { "VAR": { "id": ",S57`x^[^{+#%(k%Q5~)" } }, "inputs": { "VALUE": { "block": { "type": "hmiGetSwitch", "id": ";OlVmrI`tP2Wn98MhQ(6", "fields": { "NAME": "Switch1" } } } }, "next": { "block": { "type": "variables_set", "id": "toVbALp.{C5C+{9GMK%e", "fields": { "VAR": { "id": "xjE5n-FetBK*,)qj?pyn" } }, "inputs": { "VALUE": { "block": { "type": "text", "id": "oA52{ydq^ZsJF:O@NU,d", "fields": { "TEXT": "cok" } } } }, "next": { "block": { "type": "print", "id": "iB`R-:UTF#c3EXAU.Qh-", "inputs": { "TEXT": { "block": { "type": "variables_get", "id": "+wF~Y65u+aNA.ZX3!^Ra", "fields": { "VAR": { "id": "xjE5n-FetBK*,)qj?pyn" } } } } }, "next": { "block": { "type": "variables_set", "id": "E8`?q[Z3*IpN3,52Y=jA", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } }, "inputs": { "VALUE": { "block": { "type": "math_number", "id": "iOJP=T-{O5h_^;{Yz?%(", "fields": { "NUM": 3000 } } } }, "next": { "block": { "type": "delay", "id": "VQy`Sl3]ey49sP%+N6$R", "fields": { "DURATION_MS": 1000 }, "next": { "block": { "type": "variables_set", "id": "i|LkDgVjImZd2}owndlz", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } }, "inputs": { "VALUE": { "block": { "type": "hmiGetSlider", "id": "3;jHO[lTaxLBbEe*$~?N", "fields": { "NAME": "Slider1" } } } }, "next": { "block": { "type": "pwmWrite", "id": "Ezn#r.|lvDj5{Q1-C:E$", "fields": { "ADDRESS": "64", "CHANNEL": 0 }, "inputs": { "PWM_VALUE": { "block": { "type": "variables_get", "id": "OkA-}PRPzgi;[I)@vcG$", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } } } } }, "next": { "block": { "type": "variables_set", "id": "m{+MhlXz-1tpl`mPPBh5", "fields": { "VAR": { "id": "ju{xs[rjZumqS87$0nhu" } }, "inputs": { "VALUE": { "block": { "type": "odometryRead", "id": "v=Js89HC8D0UUA.-pN[q", "fields": { "SOURCE": "encoder" } } } }, "next": { "block": { "type": "variables_set", "id": "]LcUOwlc-y=`.e?EVgTa", "fields": { "VAR": { "id": "Ug!mIa*[PnsL?H#9Ar*G" } }, "inputs": { "VALUE": { "block": { "type": "odometryGet", "id": "VG2Q/8?zcyU}s4!W;V/M", "fields": { "FIELD": "x" }, "inputs": { "VAR": { "block": { "type": "variables_get", "id": "^AW6|z21?ycRyzJ2y5u9", "fields": { "VAR": { "id": "ju{xs[rjZumqS87$0nhu" } } } } } } } }, "next": { "block": { "type": "delay", "id": "U,h/dhHRu214`~i0M6u$", "fields": { "DURATION_MS": 1000 } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }, { "type": "procedures_defreturn", "id": "4W(2:w1NGV^I;j6@^_I|", "x": 530, "y": -30, "extraState": { "params": [ { "name": "logic", "id": "-HsGyh[-?q^.O;|%cRw=" } ] }, "icons": { "comment": { "text": "Describe this function...", "pinned": false, "height": 80, "width": 160 } }, "fields": { "NAME": "foo" }, "inputs": { "STACK": { "block": { "type": "digitalOut", "id": "@.#O-pmBQ/iD*yw?nVpw", "fields": { "GPIO": 17 }, "inputs": { "digitalOut": { "block": { "type": "variables_get", "id": "H%L0RpA8^Wt+Y~*sY0wH", "fields": { "VAR": { "id": "-HsGyh[-?q^.O;|%cRw=" } } } } }, "next": { "block": { "type": "delay", "id": "GGjd9rTd!=`+-xt[nH-l", "fields": { "DURATION_MS": 1000 } } } } }, "RETURN": { "block": { "type": "logic_boolean", "id": "xwUu7IW=*1qG5ae#*LzZ", "fields": { "BOOL": "FALSE" } } } } }, { "type": "main_hmi_program", "id": "l!A!vr#-Z*nShL9rf[fa", "x": 370, "y": 130, "inputs": { "BODY": { "block": { "type": "hmiSetButton", "id": "0mslI4E`fhAji;c29:)%", "fields": { "NAME": "Btn1", "LABEL": "Press", "COLOR": "#2196f3" }, "next": { "block": { "type": "hmiSetSwitch", "id": "Z9(pm)t5OJE/wOSg+Xm/", "fields": { "NAME": "Switch1" }, "inputs": { "STATE": { "block": { "type": "variables_get", "id": "1K:Kr/,*|b`yzsoI%M,n", "fields": { "VAR": { "id": ",S57`x^[^{+#%(k%Q5~)" } } } } }, "next": { "block": { "type": "hmiSetLed", "id": "]1*kO+b!c-UMEf9QD)Tj", "fields": { "NAME": "pinInLed", "COLOR": "#4caf50" }, "inputs": { "STATE": { "block": { "type": "logic_compare", "id": "}?u/kp[mk2!n~i8gaCPu", "fields": { "OP": "NEQ" }, "inputs": { "A": { "block": { "type": "variables_get", "id": "c;5GoC0CMnq-ck;%rMDE", "fields": { "VAR": { "id": "C_:{ED@bJimgLzEmC6(`" } } } }, "B": { "block": { "type": "math_number", "id": "#x9E1:31XXQM9stsU!TZ", "fields": { "NUM": 0 } } } } } } }, "next": { "block": { "type": "hmiSetLed", "id": "7cx}vtbz1RDUUmaiM7EW", "fields": { "NAME": "SWITCH", "COLOR": "#2196f3" }, "inputs": { "STATE": { "block": { "type": "variables_get", "id": "[rrmqtM21gFF)[f_~Nly", "fields": { "VAR": { "id": ",S57`x^[^{+#%(k%Q5~)" } } } } }, "next": { "block": { "type": "hmiSetSlider", "id": "fT?r]`hGbs8uNq.x6Q~f", "fields": { "NAME": "Slider1", "MIN": 0, "MAX": 100 }, "inputs": { "VALUE": { "block": { "type": "variables_get", "id": "lPoTKTh-11[Vvl*Pr.xB", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } } } } }, "next": { "block": { "type": "hmiSetGauge", "id": "FeWSZv_C@ci}5(#:EV.A", "fields": { "NAME": "Gauge1", "MIN": 0, "MAX": 4069 }, "inputs": { "VALUE": { "block": { "type": "variables_get", "id": "LIIgG+UMkthq!S.K}dX8", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } } } } }, "next": { "block": { "type": "hmiSetText", "id": "1d7kB$!lQpY@szAnVaLx", "fields": { "NAME": "Status" }, "inputs": { "TEXT": { "block": { "type": "variables_get", "id": "`usj,%r!VHQt}Ucr]Bxv", "fields": { "VAR": { "id": "xjE5n-FetBK*,)qj?pyn" } } } } }, "next": { "block": { "type": "hmiSetNumber", "id": "-^@C9g@boq7MU?u2E}f9", "fields": { "NAME": "Value1", "UNIT": "pin" }, "inputs": { "VALUE": { "block": { "type": "variables_get", "id": "Cpu4;(,q`6WS@(f@L,|6", "fields": { "VAR": { "id": "[g,f6Mp!O$eZPCFs0U[H" } } } } } } } } } } } } } } } } } } } } } } } ] }, "variables": [ { "name": "logic", "id": "-HsGyh[-?q^.O;|%cRw=" }, { "name": "pinIn", "id": "C_:{ED@bJimgLzEmC6(`" }, { "name": "pwm1", "id": "[g,f6Mp!O$eZPCFs0U[H" }, { "name": "odometry", "id": "ju{xs[rjZumqS87$0nhu" }, { "name": "valX", "id": "Ug!mIa*[PnsL?H#9Ar*G" }, { "name": "text", "id": "xjE5n-FetBK*,)qj?pyn" }, { "name": "switchLed", "id": ",S57`x^[^{+#%(k%Q5~)" } ] }, "hmiLayout": [ { "name": "Btn1", "type": "button", "x": 0, "y": 6, "w": 2, "h": 1, "config": { "label": "Press", "color": "#2196f3" } }, { "name": "Switch1", "type": "switch", "x": 2, "y": 7, "w": 2, "h": 1, "config": {} }, { "name": "pinInLed", "type": "led", "x": 0, "y": 1, "w": 2, "h": 1, "config": { "color": "#4caf50" } }, { "name": "SWITCH", "type": "led", "x": 2, "y": 1, "w": 2, "h": 1, "config": { "color": "#2196f3" } }, { "name": "Slider1", "type": "slider", "x": 0, "y": 2, "w": 6, "h": 1, "config": { "min": 0, "max": 100 } }, { "name": "Gauge1", "type": "gauge", "x": 0, "y": 3, "w": 6, "h": 2, "config": { "min": 0, "max": 4069 } }, { "name": "Status", "type": "text", "x": 0, "y": 0, "w": 6, "h": 1, "config": {} }, { "name": "Value1", "type": "number", "x": 4, "y": 1, "w": 2, "h": 1, "config": { "unit": "pin" } } ] }