-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.blocks
13 lines (13 loc) · 4 KB
/
main.blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="rxNRaw2[tNfq#fgjm1.O">light_level</variable><variable id="zW2P:[11[uGsA;7Z7atd">max_light</variable></variables><block type="pxt-on-start" id="GU=9gzIC##+@,/ThF|QM" x="0" y="0"><statement name="HANDLER"><block type="variables_set" id="-;WGczouEs0T1Rk,!27H"><field name="VAR" id="zW2P:[11[uGsA;7Z7atd">max_light</field><value name="VALUE"><shadow type="math_number" id="7.A|_vi,YN]9h%9Z6Nmd"><field name="NUM">25</field></shadow></value></block></statement></block><block type="device_forever" id=";^ZiT:/(bKV1SD2|=HS:" x="1" y="156"><statement name="HANDLER"><block type="variables_set" id="4]J,S7o%[vp5i7Rhz@bX"><field name="VAR" id="rxNRaw2[tNfq#fgjm1.O">light_level</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_light_level" id="X#NCy:?so{e9WX_t:k.$"/></value><next><block type="device_show_number" id="AK}]Aeql{N:(j}pzQ}Tz"><value name="number"><shadow type="math_number" id="M~:{[HvZijr8O4iM^pVs"><field name="NUM">0</field></shadow><block type="variables_get" id="6x,O(lU3Q5e8TIc(wSF["><field name="VAR" id="rxNRaw2[tNfq#fgjm1.O">light_level</field></block></value><next><block type="sb_setServoPosition" id="8LL-pxy$HlUT1$}144pq"><value name="servo"><shadow type="sb_servo" id="#f!^wqmu0osG`/Nuuvl~"><field name="label">SBServo.ServoA</field></shadow></value><value name="position"><shadow type="math_number_minmax" disabled="true"><mutation min="0" max="100" label="Position" precision="0"/><field name="SLIDER">0</field></shadow><block type="math_map" id="KOSE]QG@xX*dRzjA1=l~"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="4ZI!N(wZQY,]d38`n(/B"><field name="VAR" id="rxNRaw2[tNfq#fgjm1.O">light_level</field></block></value><value name="fromLow"><shadow type="math_number" id="jKFQYGia$gASCmca%eE)"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number"><field name="NUM">150</field></shadow><block type="variables_get" id="X[/)o]1da$uL3VT;6)83"><field name="VAR" id="zW2P:[11[uGsA;7Z7atd">max_light</field></block></value><value name="toLow"><shadow type="math_number" id="3UVUtd_GUV:QtwZN%v8j"><field name="NUM">0</field></shadow></value><value name="toHigh"><shadow type="math_number" id="bppIba]P$bL!(dvUQ3rI"><field name="NUM">5</field></shadow></value></block></value></block></next></block></next></block></statement></block><block type="controls_if" id="H6XfE7gBqLNuAGA8_yAc" disabled="true" x="-84" y="418"><mutation else="1"/><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="d-IP/hqUs?w)Wu]XV/[D" disabled="true"><field name="OP">GT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="A`=aeqCZWE:,qr7fbp)U" disabled="true"><field name="VAR" id="rxNRaw2[tNfq#fgjm1.O">light_level</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="-bLGL5:IA%5YYw1aZv~~" disabled="true"><field name="OP">DIVIDE</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="V3V{HUGVECa[ZeY=!6T`" disabled="true"><field name="VAR" id="zW2P:[11[uGsA;7Z7atd">max_light</field></block></value><value name="B"><shadow type="math_number" id="AiO-g2qM@j3.|K1DQr?f" disabled="true"><field name="NUM">2</field></shadow></value></block></value></block></value><statement name="DO0"><block type="device_show_leds" id="@_T#^eVJInNq;M3qxrj|" disabled="true"><field name="LEDS">`
# . # . #
. # # # .
# # # # #
. # # # .
# . # . #
`</field></block></statement><statement name="ELSE"><block type="device_show_leds" id="ou/[finc(5r}^gdx$RGQ" disabled="true"><field name="LEDS">`
. . . . .
. # . # .
. . # . .
. # . # .
. . . . .
`</field></block></statement></block></xml>