Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Last active August 19, 2022 04:44
Show Gist options
  • Save lupyuen/f7466a2e208eb68fd01a788c829b57e9 to your computer and use it in GitHub Desktop.
Save lupyuen/f7466a2e208eb68fd01a788c829b57e9 to your computer and use it in GitHub Desktop.
Sensor Blockly Test JSON for Zig: https://lupyuen.github.io/articles/visual
{
"blocks": {
"languageVersion": 0,
"blocks": [
{
"type": "every",
"id": "w2)KOJsZpE=7Mq-/^i8O",
"x": 38,
"y": 38,
"fields": {
"DURATION": 10
},
"inputs": {
"STMTS": {
"block": {
"type": "variables_set",
"id": "sP}k=g|HD]NF-KA=M0|M",
"fields": {
"VAR": {
"id": "[HFH-EFJL(3Ri9S~yUH5"
}
},
"inputs": {
"VALUE": {
"block": {
"type": "bme280",
"id": "m8Ew9cb8GNs{Cy|[fZKV",
"fields": {
"FIELD": "temperature",
"PATH": "/dev/uorb/sensor_baro0"
}
}
}
},
"next": {
"block": {
"type": "text_print",
"id": "~(5i{Ml[r(emfnsmxZh%",
"inputs": {
"TEXT": {
"shadow": {
"type": "text",
"id": "K[=5~LBCD+ZY?!BidoD#",
"fields": {
"TEXT": "abc"
}
},
"block": {
"type": "variables_get",
"id": "2cfaWMS#bTH3$^,gW8WI",
"fields": {
"VAR": {
"id": "[HFH-EFJL(3Ri9S~yUH5"
}
}
}
}
},
"next": {
"block": {
"type": "variables_set",
"id": "r,*_$1:z2;plYtow^6_p",
"fields": {
"VAR": {
"id": "T)]F-;I/g7~9}G0++iQW"
}
},
"inputs": {
"VALUE": {
"block": {
"type": "bme280",
"id": "%EoW*9b}wf/95w05+.XY",
"fields": {
"FIELD": "pressure",
"PATH": "/dev/uorb/sensor_baro0"
}
}
}
},
"next": {
"block": {
"type": "text_print",
"id": "FO#}Q12L7DEeu^ct$;+~",
"inputs": {
"TEXT": {
"shadow": {
"type": "text",
"id": "K[=5~LBCD+ZY?!BidoD#",
"fields": {
"TEXT": "abc"
}
},
"block": {
"type": "variables_get",
"id": "r~]4Sw$@u/V6|zF$wO(U",
"fields": {
"VAR": {
"id": "T)]F-;I/g7~9}G0++iQW"
}
}
}
}
},
"next": {
"block": {
"type": "variables_set",
"id": "92/}gRx7@0P}$|:J-UIo",
"fields": {
"VAR": {
"id": "r.;UXc8xs*w`2a];O_nT"
}
},
"inputs": {
"VALUE": {
"block": {
"type": "bme280",
"id": "$te1Y22u6S`hDQfayDB]",
"fields": {
"FIELD": "humidity",
"PATH": "/dev/uorb/sensor_humi0"
}
}
}
},
"next": {
"block": {
"type": "text_print",
"id": "9f~^hf^8]`5gEInKAy0x",
"inputs": {
"TEXT": {
"shadow": {
"type": "text",
"id": "K[=5~LBCD+ZY?!BidoD#",
"fields": {
"TEXT": "abc"
}
},
"block": {
"type": "variables_get",
"id": "P.:9;;7wBu@YKP:DYpO^",
"fields": {
"VAR": {
"id": "r.;UXc8xs*w`2a];O_nT"
}
}
}
}
},
"next": {
"block": {
"type": "variables_set",
"id": "La+SK,4Nnp}Dr!VAu[$9",
"fields": {
"VAR": {
"id": "73I5|cMkw3NL|u4$$tCD"
}
},
"inputs": {
"VALUE": {
"block": {
"type": "compose_msg",
"id": "0#%xC52)3|_TZ2mxq%L;",
"extraState": "<mutation xmlns=\"http://www.w3.org/1999/xhtml\" items=\"3\"></mutation>",
"inputs": {
"ADD0": {
"block": {
"type": "field",
"id": "*@VjJ2lV00CK_N!Afh`P",
"fields": {
"NAME": "t"
},
"inputs": {
"name": {
"block": {
"type": "math_arithmetic",
"id": "y:~/2zx^iu.h#za:9}D(",
"fields": {
"OP": "MULTIPLY"
},
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"id": ")r5/uTK[?l$UFaEaw*dU",
"fields": {
"NUM": 1
}
},
"block": {
"type": "variables_get",
"id": "C00Jm,em9O)xB3?`ijhr",
"fields": {
"VAR": {
"id": "[HFH-EFJL(3Ri9S~yUH5"
}
}
}
},
"B": {
"shadow": {
"type": "math_number",
"id": ")a4B*R-Sd(QI:cW`B,@}",
"fields": {
"NUM": 100
}
}
}
}
}
}
}
}
},
"ADD1": {
"block": {
"type": "field",
"id": "M[ewzgJq+|2Z)=buN~4(",
"fields": {
"NAME": "p"
},
"inputs": {
"name": {
"block": {
"type": "math_arithmetic",
"id": "3Mm7[`Z]Y(gw/(n1AC!7",
"fields": {
"OP": "MULTIPLY"
},
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"id": ")r5/uTK[?l$UFaEaw*dU",
"fields": {
"NUM": 1
}
},
"block": {
"type": "variables_get",
"id": "]s%by9qbsezkpP9^q7EM",
"fields": {
"VAR": {
"id": "T)]F-;I/g7~9}G0++iQW"
}
}
}
},
"B": {
"shadow": {
"type": "math_number",
"id": "m^(qRO]XAG`}$)d/XZSJ",
"fields": {
"NUM": 100
}
}
}
}
}
}
}
}
},
"ADD2": {
"block": {
"type": "field",
"id": "Grzr,dzogCwPV$8KT~_0",
"fields": {
"NAME": "h"
},
"inputs": {
"name": {
"block": {
"type": "math_arithmetic",
"id": "r1Ji{zIL@8+99}(I3Zi}",
"fields": {
"OP": "MULTIPLY"
},
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"id": ")r5/uTK[?l$UFaEaw*dU",
"fields": {
"NUM": 1
}
},
"block": {
"type": "variables_get",
"id": "j78`]qN3C*+jXKorHG}.",
"fields": {
"VAR": {
"id": "r.;UXc8xs*w`2a];O_nT"
}
}
}
},
"B": {
"shadow": {
"type": "math_number",
"id": "w3hEZ08)9lA~+u6A6nXN",
"fields": {
"NUM": 100
}
}
}
}
}
}
}
}
}
}
}
}
},
"next": {
"block": {
"type": "transmit_msg",
"id": "@y~KQ?C7-[I[h@u%AvrQ",
"fields": {
"TO": "lorawan"
},
"inputs": {
"MSG": {
"block": {
"type": "variables_get",
"id": "_yq[3kxBG|5,{Y:%YME=",
"fields": {
"VAR": {
"id": "73I5|cMkw3NL|u4$$tCD"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
]
},
"variables": [
{
"name": "temperature",
"id": "[HFH-EFJL(3Ri9S~yUH5"
},
{
"name": "msg",
"id": "73I5|cMkw3NL|u4$$tCD"
},
{
"name": "pressure",
"id": "T)]F-;I/g7~9}G0++iQW"
},
{
"name": "humidity",
"id": "r.;UXc8xs*w`2a];O_nT"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment