2 – Kaugummiautomat aus PET Flasche: oder doch eine Erbsen-Zählmaschine?

2

Kaugummiautomat aus PET Flasche: oder doch eine Erbsen-Zählmaschine?

Das lernst du hier

Ein Kaugummiautomat ist eine faszinierende Maschine, denn eine ausgeklügelte Mechanik und ein Arduino-Servo erlauben die Ausgabe von Kaugummis per Knopfdruck. Zudem kannst du mit der gleichen Apparatur auch andere Aufgaben erfüllen: Warum nicht eine Maschine bauen, die Kichererbsen oder trockene Bohnen zählt, wenn du sie oben in den Trichter gibst?

Einfache Konstruktion, anspruchsvolle Details

Obwohl die hier vorgeschlagene Konstruktion aus einer PET-Flasche und einem Stück Schweissdraht einfach und schnell gebaut ist, wirst du sehen, dass der Teufel im Detail steckt: Es ist gar nicht so einfach zu erreichen, dass der Automat immer nur einen Kaugummi ausgibt. Experimentiere darum mit der Biegeform des Drahtes, der Beschaffenheit des Ausgabe-Slots und der Geschwindigkeit des Servos.

2a

Was ist ein Servo und was ist ein Licht-Sensor?

Wie geht das?

Ein Servo ist ein Motor der ziemlich kräftig ist und dessen Position du auf den Millimeter genau einstellen kannst. Mit einem Servohorn und einem Stück Draht kannst du so Dinge bewegen, denn das Servo kann sich im Winkel von bis zu 0° bis 180° drehen. Hier findest du unsere detaillierte Anleitung, wie du ein Servo mit dem Arduino steuerst.

Ein Lichtsensor (Fotowiderstand, LDR) ist ein Widerstand, der wie ein Schalter funktioniert, sobald er Licht sieht oder ganz im Dunkeln ist. Lege einfach deinen Finger direkt auf den Sensor, um die Ausgabe eines Kaugummis auszulösen. Hier findest du eine Anleitung, wie der Lichtsensor angeschlossen und programmiert wird.

2b

Servo und Lichtsensor anschliessen

2c

Apparatur aus einer PET-Flasche bauen

Eine PET-Flasche ist das ideale Ausgangsmaterial für deinen Automaten, denn sie lässt sich leicht mit einer Schere oder einem Cutter bearbeiten und mit Malerklebband neu zusammensetzen! Wir haben die Konstruktion als 3D-Modell skizziert, als Vorschlag, wie der Automat funktionieren könnte. Zoome hinein und studiere die Details, damit du deine eigenen Ideen und Verbesserungen finden kannst. Im Internet gibt es viele weitere Anleitungen, die dich inspirieren: Kaugummiautomat im Internet

2d

Schiebemechanismus über Draht mit Servo verbinden

Sobald du dich für eine Grundkonstruktion entschieden hast, geht es um die eigentliche Mechanik. Wie soll der Draht gebogen werden, damit er die Kugel sauber aus dem Fallrohr schiebt, ohne dass er sich mit den Kaugummis, die von oben kommen, verheddert? Zoome in das 3D-Modell und studiere die Details.

Tipp: Schweissdraht eignet sich gut für die Übertragung von Bewegung. Um diesen in das Servohorn zu stecken muss er eventuell mit einer Flamme erhitzt werden. Frage deine TTG-Lehrperson!

2e

Servo programmieren und mit Fotowiderstand-Schalter steuern

Die Programmierung des Servos ist simpel, denn du kannst direkt die Lage in ° angeben. Finde einfach heraus, welche beiden Positionen dein Servo anfahren muss, um den Kaugummi auszugeben. Schaffst du es, dass immer nur ein Kaugummi aus dem Automaten kommt?

Tipp: Wenn du den Finger auf den Fotowiderstand legst, misst er weniger Licht als 30%. Nutze diese Schwelle, um die Ausgaben eines Kaugummis auszulösen! Dies funktioniert natürlich nur, wenn genügend Tageslicht vorhanden ist, falls du keinen Kaugummi ausgeben willst 😉.

Challenge:

Challenge: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="_DQjdhaJfR6,f$7cgOQ7">Position in °</variable><variable id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</variable><variable id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</variable><variable id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</variable><variable id="|H,0pDre=%.#lJkTh33Q">Tempo in %</variable><variable id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</variable><variable id="8[tP-gnNag|U*w*Y^_4=">Farbe°</variable><variable id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</variable><variable id="Lb]X9XmRcPagndnTyucG">Helligkeit %</variable><variable id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</variable><variable id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</variable><variable id="K:G4UACKdRDr(dE9O39G">Pos 1</variable><variable id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</variable><variable id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</variable><variable id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</variable></variables><block type="basic_comment" id="a8c{3fPUYGA.^d((01Ox" x="-131" y="-44"><field name="COMMENT">Kaugummiautomat Grundfunktion: setze diese Programmblöcke in den Hauptloop ein!</field></block><block type="basic_comment" id="|.$x+yKiz`j-,~[?eRLs" x="-700" y="32"><field name="COMMENT">Nicht löschen, Unterprogramme</field></block><block type="procedures_callnoreturn" id="+Dik-l#xDh27XSm4_Ez*" x="-1168" y="88"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="FuKA)24e!YPnL!6uVGNQ"><field name="NUM">0</field></block></value><value name="ARG1"><block type="led_pin" id="*N?*%c`@1TVI3UGN1p?N"><field name="LED">LED2</field></block></value></block><block type="basic_main_loop" id="9~210UV)!{|GniQxFn|[" deletable="false" x="-131" y="37"><value name="BLINK"><block type="basic_blinkcode" id="u@6%knhMhK2g(1JYw[10"><field name="SHORT">1</field><field name="LONG">1</field></block></value></block><block type="procedures_defnoreturn" id="DYYovfp[/{/^ryWHZBvf" collapsed="true" x="-700" y="91"><mutation><arg name="Position in °" varid="_DQjdhaJfR6,f$7cgOQ7"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="variables_set" id="b*l`jfDpwv@_`yEQ:sQU"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="VALUE"><block type="math_map" id="wY2I~E@9)6mqH{`4}Min"><value name="VALUE"><block type="variables_get" id="sM%OH#-),/XvNLAfoDgM"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><value name="FROMLOW"><block type="math_number" id="5*[TWQi3eTy;dTNqRejO"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="3FohKj*x~t~gZ.sYtS2("><field name="NUM">180</field></block></value><value name="TOLOW"><block type="math_number" id="y+3B7BV,l3#e!tC#zP45"><field name="NUM">450</field></block></value><value name="TOHIGH"><block type="math_number" id="n[XOgoHB+-0i.,Gpwf%1"><field name="NUM">2550</field></block></value></block></value><next><block type="variables_set" id=".xsEB~Y8Qx!^%8P%)mh;"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field><value name="VALUE"><block type="math_arithmetic" id="{F9Honx#=x}}p5s6~3pd"><field name="OP">MINUS</field><value name="A"><block type="math_number" id="nN}B3!9SLvv*1{Zlf(%h"><field name="NUM">20000</field></block></value><value name="B"><block type="variables_get" id="mZbi[2Xx35m9qZ2Wz|b_"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><next><block type="flow_repeat" id="gN=t~3M0%R7Pe)/i-V4G"><value name="REPEATS"><block type="math_number" id="+qOr!,*|C9.5wJ[w,ENN"><field name="NUM">4</field></block></value><statement name="DO"><block type="led_write_state" id="6!l6z?iL+={{9KAi,H|9"><value name="LED"><block type="variables_get" id="0L`R`5_!X{Az,9F)`Qac"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="+7pwX/P2*!~K,CbqH7gH"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="Y3736,h2Aea/$FEM%mGd"><value name="DELAY_MICRO"><block type="variables_get" id=")Lg-8viw{x?GWSZtdPfK"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><next><block type="led_write_state" id="=R-dB9$gUgUf[f1#amX?"><value name="LED"><block type="variables_get" id="L{aTSjwfCBro[60WW.0E"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="ZI?r50,S}Q!N4EWcI9rk"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="7il;NbzoR^Es7say`(zt"><value name="DELAY_MICRO"><block type="variables_get" id="|@!H=EXua/xr-NRDCr5g"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field></block></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="2J_{LmcNIYk{Z?kV+;::" x="-1468" y="141"><mutation name="stelle Servo sanft"><arg name="von Pos in °"></arg><arg name="bis Pos in °"></arg><arg name="Tempo in %"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="]_j_u)];;xHA8-_B3$7B"><field name="NUM">0</field></block></value><value name="ARG1"><block type="math_number" id="]W:g?fprmZ}8_8xDy2JB"><field name="NUM">160</field></block></value><value name="ARG2"><block type="math_number" id="z{3!U)]mou,t,b?*wzax"><field name="NUM">50</field></block></value><value name="ARG3"><block type="led_pin" id="wew.m#TufNiqRG~QVRLG"><field name="LED">LED2</field></block></value></block><block type="procedures_defnoreturn" id="c^Q=?l{x:FJ?Cm3Ncch(" collapsed="true" x="-701" y="146"><mutation><arg name="von Pos in °" varid="DoyC0N[TR?Wtuv+]QNjk"></arg><arg name="bis Pos in °" varid="8M|lsZfG.{JMk^B,=:P["></arg><arg name="Tempo in %" varid="|H,0pDre=%.#lJkTh33Q"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo sanft</field><statement name="STACK"><block type="flow_for" id="MoL^$qp,s]q|#V}PCNel"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="FROM"><block type="math_number" id="V;Ieuii8?o:Tnb.0[a[N"><field name="NUM">0</field></block></value><value name="TO"><block type="math_number" id="^-^,ZT.?5jVw*o/}OAU@"><field name="NUM">3.141</field></block></value><value name="BY"><block type="math_map" id="XD^P~Qk|P($W8{5DOc}p"><value name="VALUE"><block type="variables_get" id="E?Zd6*s)DOd5/Y_5,2lM"><field name="VAR" id="|H,0pDre=%.#lJkTh33Q">Tempo in %</field></block></value><value name="FROMLOW"><block type="math_number" id="%GC=-JD8|y;:B[[f[n#U"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id=".ZWBxd~-|{*~cc2o9|q7"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="f%@Q!+NEovExdlCD_d#n"><field name="NUM">0.001</field></block></value><value name="TOHIGH"><block type="math_number" id="relQ-8H6-k~[,FEIc#HH"><field name="NUM">0.1</field></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="h,f[+#.Bb}Xe`}luH7k@"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_map" id="mwXTpN_o):;]m;don~^w"><value name="VALUE"><block type="math_trig" id="*CoOOO~/KSP!ivteXph]"><field name="OP">COS</field><value name="NUM"><block type="variables_get" id="r@^JSALbD:Ryki$nBg.;"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="{w-,lfw.uDu:8c/o=obQ"><field name="NUM">1</field></block></value><value name="FROMHIGH"><block type="math_number" id="Xa^2u$_Kn+/@4V/)o(-j"><field name="NUM">-1</field></block></value><value name="TOLOW"><block type="variables_get" id="wU4r,RDpQh@jfxg;EcxR"><field name="VAR" id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</field></block></value><value name="TOHIGH"><block type="variables_get" id="8P)Er_m+.;4yannpX11Q"><field name="VAR" id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</field></block></value></block></value><value name="ARG1"><block type="variables_get" id="$cU5xUL=@X?`I5bGb%`r"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value></block></statement></block></statement></block><block type="procedures_callnoreturn" id="8p[FYrS#;JRm9^08:pCC" x="-128" y="136"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="dYePR2W6Y2?J#uFe+jJ("><field name="NUM">0</field></block></value><value name="ARG1"><block type="led_pin" id="jxp*@dwH|4:5jgRGl$S7"><field name="LED">LED2</field></block></value></block><block type="procedures_defreturn" id="VnG.[Xi?K@xVOSmR%A:Q" collapsed="true" x="-700" y="202"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="(YnUm|J,9fsc(p4r9s;7"><value name="LED"><block type="led_pin" id="H.T)=mm`Ifwv2Fhc|S2f"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="2?t[*AxO#`+[63!Kbv|4"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="wg)XFQj(bZQ@7;s8Xn)g"><value name="DELAY_MICRO"><block type="math_number" id="+-ylq#`F5bV2s=I1tqw5"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="^{tG^[d%-ztHVl2chmz3"><value name="LED"><block type="led_pin" id="v*lb+hhl[Wi(7pV0Rh2Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="W@AYsU^fM(0P#-M5(rD5"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="b1cIi4)J^l_l*FFQ9YDW"><value name="DELAY_MICRO"><block type="math_number" id=";%*_lC[QmT=aFvU2dBmT"><field name="NUM">10</field></block></value><next><block type="led_write_state" id=")#=atR)n~|WSuN9-h*qS"><value name="LED"><block type="led_pin" id="vt(XIF^r7P4^(:[t9(|Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="mC9fceq(Z!8lgrV}*q#s"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="abkprn]D|R;FJkV?c1X%"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field><value name="VALUE"><block type="code_pin" id="^l1C}Yuf?uC!$*grR2(~"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="flow_delay" id="^~$p)C+|`cXjw=]|)4vk"><value name="DELAY"><block type="math_number" id="e`),5T9$86+YFbpttWJ4"><field name="NUM">5</field></block></value><next><block type="variables_set" id="%KSHJ,gWN(m1+Bf15WL-"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="H!$n-us!:]A80ihl_Z)M"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="5jMKhuU|jo^bbm)GwQ7-"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="eWh9Q^v9;dBK`FlU1YC]"><field name="NUM">0.0175</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="^0,i^h8Sw0}Qz*WLV`X{"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field></block></value></block><block type="procedures_callnoreturn" id="6zA*:f_gj4!Y1wAts=I:" x="-1435" y="244"><mutation name="Leuchte Matrix"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6eH}UwR355Ir_o1o}P[A"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="zhx`E`0qUks52ggh-(}="><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id="V;#@D/M5)S6m%xdKz/z+"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="!48bdi#]0mb|H[hfs:vz"><field name="NUM">100</field></block></value></block><block type="procedures_callnoreturn" id="e{rJu8qOi`idKo+c,D,f" x="-129" y="206"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="4zz~d6zF/F_r_28R)3pM"><field name="NUM">0</field></block></value><value name="ARG1"><block type="led_pin" id="p`hzR%+5i]|YljP^F^0i"><field name="LED">LED2</field></block></value></block><block type="procedures_defnoreturn" id="uCP4HJbTMu0Zs76)CH^*" collapsed="true" x="-699" y="255"><mutation><arg name="Dezimalcode" varid="PzJaWVHX--]9?^N_)#wn"></arg><arg name="Farbe°" varid="8[tP-gnNag|U*w*Y^_4="></arg><arg name="Sättigung %" varid="MO}nJEF/,hGyd-x(^`q+"></arg><arg name="Helligkeit %" varid="Lb]X9XmRcPagndnTyucG"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="nh)v2ZA`5dpjzyDpQX#z"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="variables_get" id="^li}kpVfk7H3`Q_jLYoy"><field name="VAR" id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</field></block></value><next><block type="flow_for" id="90kB-:lp[/3CT_350=px"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field><value name="FROM"><block type="math_number" id="*Xvn5xNcS[?2T`,~7I5q"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="~f`g9tSYD5h]Z)7?:`]4"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id=",gmTJOc!M8!inOVHJi;6"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="Up9aahxIfp[A%L`*Qnw1"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field><value name="VALUE"><block type="math_single_basic" id="/-i*-sbO:D!TU},#QTCN"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="tNQ($77tg3dW_eA{.W__"><value name="VAL1"><block type="code_pin" id="Ho#O^)5rv:^elTerYa/i"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="TIRieh|^WvQ)IOUq$fi^"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="gITwD)p3W.y@gfxR4gbG"><value name="IF0"><block type="logic_compare" id="eDcSt_#5NnU08uvz0pgk"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="!XYhs#osSAJTEADJ}6gQ"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="math_number" id="+lm+(l$_$,BcMq?P1c%%"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="702Ct0l!zs6,HtbKhAT;"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="qd~K,2KGT``,Qk5=L2Ko"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field></block></value><value name="TO"><block type="math_number" id="S`I(;g-TR|y%C64eydmY"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="[^#q@00stBpa$0:pt-#f"><field name="VAR" id="8[tP-gnNag|U*w*Y^_4=">Farbe°</field></block></value><value name="S"><block type="variables_get" id="6,z;zXo#*C4h)KwPOI{W"><field name="VAR" id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="F1Q@ZE3YeG7ZDB|NZkI)"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="9HO@{A:Y?+a+Y/!N6R[J"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="variables_get" id="AuAXZu#PAnd.R%;}!tlY"><field name="VAR" id="Lb]X9XmRcPagndnTyucG">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="ow7L]s$H4X|57O@gb2#v"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="S3(5ARcsl|s@Y{r:0_x+"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="qef@UewcAWFW!TP)?oC9"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="cya`+vH7WvVKaKL:8W-1"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="_fCbV+Rq~kcHsHQI352#"><next><block type="fast_led_clear" id=".`tP8|ysi7FVqWc089aH"></block></next></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="437YsL9XN%em{}Ohn3,b" x="-1509" y="306"><mutation name="Matrix in Zwischenspeicher"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6}rQk~R/q.zVpia`AA[s"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="RuG{G{%r]$$NVDOJN3x+"><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id="j]_BOu{B~_-mNoL52/^h"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="^QMtS4)|Q59[B(6OKOGv"><field name="NUM">100</field></block></value></block><block type="procedures_defnoreturn" id="}f8qz_?3-H.xNQ7IOd/=" collapsed="true" x="-697" y="309"><mutation><arg name="Dezimalcode" varid="PzJaWVHX--]9?^N_)#wn"></arg><arg name="Farbe°" varid="8[tP-gnNag|U*w*Y^_4="></arg><arg name="Sättigung %" varid="MO}nJEF/,hGyd-x(^`q+"></arg><arg name="Helligkeit %" varid="Lb]X9XmRcPagndnTyucG"></arg></mutation><field name="NAME">Matrix in Zwischenspeicher</field><statement name="STACK"><block type="variables_set" id="Z9CYP7:vA5mvz(_8z*Dt"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="variables_get" id="66/66^YY2[p`W/;*LTp)"><field name="VAR" id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</field></block></value><next><block type="flow_for" id="-`XaNw0I4204MC6.:sXL"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field><value name="FROM"><block type="math_number" id="?o*6]nP1m+MSJ74ak]o^"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="G:_N:4gCwPs6D-i0OF_;"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="/cIa1M(6yC`wziM@iQi;"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="]fIfJR#}_^i8J_53/JJ/"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field><value name="VALUE"><block type="math_single_basic" id="(kQ.?wOh[@,Ll)CNkGu#"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="GDiE4`iQV%Rem*DYnUNU"><value name="VAL1"><block type="code_pin" id="DP-Ir.`-/he_=junA([#"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="LwN/4JSj(QT.@ojxo`f$"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="edL0[5,ZbG%bIJkcDk@v"><value name="IF0"><block type="logic_compare" id="l,kR$cME#rSK~hM}@SJJ"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="ImQNOlWP4*Aoy_3!yUhE"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="math_number" id="xAAq|*@mNPL%TQ*,a]NN"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="A%!ld+#i%[!Q=-Bjy8p9"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="2PRjxeTpxt%ErDx$u6*X"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field></block></value><value name="TO"><block type="math_number" id="Onnp4^BS1]Iy-{z!`mPM"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="5dALxK|(,/_Q.7luty[W"><field name="VAR" id="8[tP-gnNag|U*w*Y^_4=">Farbe°</field></block></value><value name="S"><block type="variables_get" id="S7N[bf3;7QR`C]iGzW!5"><field name="VAR" id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="}xG0Uc9.8`kZNcO:PvYF"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="_oo_Oq7L2@7_UzC36.x;"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="variables_get" id="V!Pl2klmOXiI#`]`BXup"><field name="VAR" id="Lb]X9XmRcPagndnTyucG">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="K1S5u~KN7fG09o:@4k-_"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="S!wp|m=b2EpYo0^Z[nUK"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="@MZ8(:-MT=bCc;*%].7="><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id=",}2FU}vf,Ub.$`Xq*(6z"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement></block></next></block></statement></block><block type="logic_if" id="7wwHdeF,h+(AqoJGELL0" x="-125" y="286"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation></block><block type="set_neo_pixel" id="!Om9r{B%q#Ax%A]Do=O0" x="-1341" y="372"><value name="NUM_LEDS"><block type="math_number" id="sGg3N3FKmd)8(6;uEI{*"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="W2KAj#}-gE`P}9v*v)3B"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="9-MqZA.)f?Uo,GG(]b7X"><field name="LED">LED1</field></block></value></block><block type="logic_compare" id="Yo+C@h#~}cTlnV)Hpm9I" x="-130" y="411"><field name="OP">LT</field></block><block type="sensor_read_percentage" id="oa7dSkBE|G]NJ?m2TCzt" x="-128" y="479"><value name="SENSOR"><block type="sensor_pin" id="VzWiLT|x4*BdEOK}C_Z]"><field name="SENSOR">SENSOR1</field></block></value></block><block type="math_number" id="]+nqj!b;A~0%sb%F|]+e" x="-126" y="545"><field name="NUM">10</field></block><block type="flow_delay" id="3x4}?U8Um4VtTJExLSbW" x="-120" y="606"><value name="DELAY"><block type="math_number" id="byU@x!+i=[jd(7n|yfQ%"><field name="NUM">500</field></block></value></block></xml>

Mögliche Lösung:

Lösung: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="_DQjdhaJfR6,f$7cgOQ7">Position in °</variable><variable id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</variable><variable id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</variable><variable id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</variable><variable id="|H,0pDre=%.#lJkTh33Q">Tempo in %</variable><variable id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</variable><variable id="8[tP-gnNag|U*w*Y^_4=">Farbe°</variable><variable id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</variable><variable id="Lb]X9XmRcPagndnTyucG">Helligkeit %</variable><variable id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</variable><variable id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</variable><variable id="K:G4UACKdRDr(dE9O39G">Pos 1</variable><variable id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</variable><variable id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</variable><variable id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</variable></variables><block type="basic_comment" id="a8c{3fPUYGA.^d((01Ox" x="-131" y="-44"><field name="COMMENT">Kaugummiautomat Grundfunktion</field></block><block type="basic_comment" id="|.$x+yKiz`j-,~[?eRLs" x="-700" y="32"><field name="COMMENT">Nicht löschen, Unterprogramme</field></block><block type="procedures_callnoreturn" id="+Dik-l#xDh27XSm4_Ez*" x="-1168" y="88"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="FuKA)24e!YPnL!6uVGNQ"><field name="NUM">0</field></block></value><value name="ARG1"><block type="led_pin" id="*N?*%c`@1TVI3UGN1p?N"><field name="LED">LED2</field></block></value></block><block type="basic_main_loop" id="9~210UV)!{|GniQxFn|[" deletable="false" x="-131" y="37"><value name="BLINK"><block type="basic_blinkcode" id="u@6%knhMhK2g(1JYw[10"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="7wwHdeF,h+(AqoJGELL0"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="Yo+C@h#~}cTlnV)Hpm9I"><field name="OP">LT</field><value name="A"><block type="sensor_read_percentage" id="oa7dSkBE|G]NJ?m2TCzt"><value name="SENSOR"><block type="sensor_pin" id="VzWiLT|x4*BdEOK}C_Z]"><field name="SENSOR">SENSOR1</field></block></value></block></value><value name="B"><block type="math_number" id="]+nqj!b;A~0%sb%F|]+e"><field name="NUM">10</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="8p[FYrS#;JRm9^08:pCC"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="dYePR2W6Y2?J#uFe+jJ("><field name="NUM">20</field></block></value><value name="ARG1"><block type="led_pin" id="jxp*@dwH|4:5jgRGl$S7"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="3x4}?U8Um4VtTJExLSbW"><value name="DELAY"><block type="math_number" id="byU@x!+i=[jd(7n|yfQ%"><field name="NUM">500</field></block></value></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="e{rJu8qOi`idKo+c,D,f"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="4zz~d6zF/F_r_28R)3pM"><field name="NUM">80</field></block></value><value name="ARG1"><block type="led_pin" id="p`hzR%+5i]|YljP^F^0i"><field name="LED">LED2</field></block></value></block></statement></block></statement></block><block type="procedures_defnoreturn" id="DYYovfp[/{/^ryWHZBvf" collapsed="true" x="-700" y="91"><mutation><arg name="Position in °" varid="_DQjdhaJfR6,f$7cgOQ7"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="variables_set" id="b*l`jfDpwv@_`yEQ:sQU"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="VALUE"><block type="math_map" id="wY2I~E@9)6mqH{`4}Min"><value name="VALUE"><block type="variables_get" id="sM%OH#-),/XvNLAfoDgM"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><value name="FROMLOW"><block type="math_number" id="5*[TWQi3eTy;dTNqRejO"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="3FohKj*x~t~gZ.sYtS2("><field name="NUM">180</field></block></value><value name="TOLOW"><block type="math_number" id="y+3B7BV,l3#e!tC#zP45"><field name="NUM">450</field></block></value><value name="TOHIGH"><block type="math_number" id="n[XOgoHB+-0i.,Gpwf%1"><field name="NUM">2550</field></block></value></block></value><next><block type="variables_set" id=".xsEB~Y8Qx!^%8P%)mh;"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field><value name="VALUE"><block type="math_arithmetic" id="{F9Honx#=x}}p5s6~3pd"><field name="OP">MINUS</field><value name="A"><block type="math_number" id="nN}B3!9SLvv*1{Zlf(%h"><field name="NUM">20000</field></block></value><value name="B"><block type="variables_get" id="mZbi[2Xx35m9qZ2Wz|b_"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><next><block type="flow_repeat" id="gN=t~3M0%R7Pe)/i-V4G"><value name="REPEATS"><block type="math_number" id="+qOr!,*|C9.5wJ[w,ENN"><field name="NUM">4</field></block></value><statement name="DO"><block type="led_write_state" id="6!l6z?iL+={{9KAi,H|9"><value name="LED"><block type="variables_get" id="0L`R`5_!X{Az,9F)`Qac"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="+7pwX/P2*!~K,CbqH7gH"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="Y3736,h2Aea/$FEM%mGd"><value name="DELAY_MICRO"><block type="variables_get" id=")Lg-8viw{x?GWSZtdPfK"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><next><block type="led_write_state" id="=R-dB9$gUgUf[f1#amX?"><value name="LED"><block type="variables_get" id="L{aTSjwfCBro[60WW.0E"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="ZI?r50,S}Q!N4EWcI9rk"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="7il;NbzoR^Es7say`(zt"><value name="DELAY_MICRO"><block type="variables_get" id="|@!H=EXua/xr-NRDCr5g"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field></block></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="2J_{LmcNIYk{Z?kV+;::" x="-1468" y="141"><mutation name="stelle Servo sanft"><arg name="von Pos in °"></arg><arg name="bis Pos in °"></arg><arg name="Tempo in %"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="]_j_u)];;xHA8-_B3$7B"><field name="NUM">0</field></block></value><value name="ARG1"><block type="math_number" id="]W:g?fprmZ}8_8xDy2JB"><field name="NUM">160</field></block></value><value name="ARG2"><block type="math_number" id="z{3!U)]mou,t,b?*wzax"><field name="NUM">50</field></block></value><value name="ARG3"><block type="led_pin" id="wew.m#TufNiqRG~QVRLG"><field name="LED">LED2</field></block></value></block><block type="procedures_defnoreturn" id="c^Q=?l{x:FJ?Cm3Ncch(" collapsed="true" x="-701" y="146"><mutation><arg name="von Pos in °" varid="DoyC0N[TR?Wtuv+]QNjk"></arg><arg name="bis Pos in °" varid="8M|lsZfG.{JMk^B,=:P["></arg><arg name="Tempo in %" varid="|H,0pDre=%.#lJkTh33Q"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo sanft</field><statement name="STACK"><block type="flow_for" id="MoL^$qp,s]q|#V}PCNel"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="FROM"><block type="math_number" id="V;Ieuii8?o:Tnb.0[a[N"><field name="NUM">0</field></block></value><value name="TO"><block type="math_number" id="^-^,ZT.?5jVw*o/}OAU@"><field name="NUM">3.141</field></block></value><value name="BY"><block type="math_map" id="XD^P~Qk|P($W8{5DOc}p"><value name="VALUE"><block type="variables_get" id="E?Zd6*s)DOd5/Y_5,2lM"><field name="VAR" id="|H,0pDre=%.#lJkTh33Q">Tempo in %</field></block></value><value name="FROMLOW"><block type="math_number" id="%GC=-JD8|y;:B[[f[n#U"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id=".ZWBxd~-|{*~cc2o9|q7"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="f%@Q!+NEovExdlCD_d#n"><field name="NUM">0.001</field></block></value><value name="TOHIGH"><block type="math_number" id="relQ-8H6-k~[,FEIc#HH"><field name="NUM">0.1</field></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="h,f[+#.Bb}Xe`}luH7k@"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_map" id="mwXTpN_o):;]m;don~^w"><value name="VALUE"><block type="math_trig" id="*CoOOO~/KSP!ivteXph]"><field name="OP">COS</field><value name="NUM"><block type="variables_get" id="r@^JSALbD:Ryki$nBg.;"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="{w-,lfw.uDu:8c/o=obQ"><field name="NUM">1</field></block></value><value name="FROMHIGH"><block type="math_number" id="Xa^2u$_Kn+/@4V/)o(-j"><field name="NUM">-1</field></block></value><value name="TOLOW"><block type="variables_get" id="wU4r,RDpQh@jfxg;EcxR"><field name="VAR" id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</field></block></value><value name="TOHIGH"><block type="variables_get" id="8P)Er_m+.;4yannpX11Q"><field name="VAR" id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</field></block></value></block></value><value name="ARG1"><block type="variables_get" id="$cU5xUL=@X?`I5bGb%`r"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value></block></statement></block></statement></block><block type="procedures_defreturn" id="VnG.[Xi?K@xVOSmR%A:Q" collapsed="true" x="-700" y="202"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="(YnUm|J,9fsc(p4r9s;7"><value name="LED"><block type="led_pin" id="H.T)=mm`Ifwv2Fhc|S2f"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="2?t[*AxO#`+[63!Kbv|4"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="wg)XFQj(bZQ@7;s8Xn)g"><value name="DELAY_MICRO"><block type="math_number" id="+-ylq#`F5bV2s=I1tqw5"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="^{tG^[d%-ztHVl2chmz3"><value name="LED"><block type="led_pin" id="v*lb+hhl[Wi(7pV0Rh2Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="W@AYsU^fM(0P#-M5(rD5"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="b1cIi4)J^l_l*FFQ9YDW"><value name="DELAY_MICRO"><block type="math_number" id=";%*_lC[QmT=aFvU2dBmT"><field name="NUM">10</field></block></value><next><block type="led_write_state" id=")#=atR)n~|WSuN9-h*qS"><value name="LED"><block type="led_pin" id="vt(XIF^r7P4^(:[t9(|Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="mC9fceq(Z!8lgrV}*q#s"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="abkprn]D|R;FJkV?c1X%"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field><value name="VALUE"><block type="code_pin" id="^l1C}Yuf?uC!$*grR2(~"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="flow_delay" id="^~$p)C+|`cXjw=]|)4vk"><value name="DELAY"><block type="math_number" id="e`),5T9$86+YFbpttWJ4"><field name="NUM">5</field></block></value><next><block type="variables_set" id="%KSHJ,gWN(m1+Bf15WL-"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="H!$n-us!:]A80ihl_Z)M"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="5jMKhuU|jo^bbm)GwQ7-"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="eWh9Q^v9;dBK`FlU1YC]"><field name="NUM">0.0175</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="^0,i^h8Sw0}Qz*WLV`X{"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field></block></value></block><block type="procedures_callnoreturn" id="6zA*:f_gj4!Y1wAts=I:" x="-1435" y="244"><mutation name="Leuchte Matrix"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6eH}UwR355Ir_o1o}P[A"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="zhx`E`0qUks52ggh-(}="><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id="V;#@D/M5)S6m%xdKz/z+"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="!48bdi#]0mb|H[hfs:vz"><field name="NUM">100</field></block></value></block><block type="procedures_defnoreturn" id="uCP4HJbTMu0Zs76)CH^*" collapsed="true" x="-699" y="255"><mutation><arg name="Dezimalcode" varid="PzJaWVHX--]9?^N_)#wn"></arg><arg name="Farbe°" varid="8[tP-gnNag|U*w*Y^_4="></arg><arg name="Sättigung %" varid="MO}nJEF/,hGyd-x(^`q+"></arg><arg name="Helligkeit %" varid="Lb]X9XmRcPagndnTyucG"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="nh)v2ZA`5dpjzyDpQX#z"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="variables_get" id="^li}kpVfk7H3`Q_jLYoy"><field name="VAR" id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</field></block></value><next><block type="flow_for" id="90kB-:lp[/3CT_350=px"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field><value name="FROM"><block type="math_number" id="*Xvn5xNcS[?2T`,~7I5q"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="~f`g9tSYD5h]Z)7?:`]4"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id=",gmTJOc!M8!inOVHJi;6"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="Up9aahxIfp[A%L`*Qnw1"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field><value name="VALUE"><block type="math_single_basic" id="/-i*-sbO:D!TU},#QTCN"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="tNQ($77tg3dW_eA{.W__"><value name="VAL1"><block type="code_pin" id="Ho#O^)5rv:^elTerYa/i"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="TIRieh|^WvQ)IOUq$fi^"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="gITwD)p3W.y@gfxR4gbG"><value name="IF0"><block type="logic_compare" id="eDcSt_#5NnU08uvz0pgk"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="!XYhs#osSAJTEADJ}6gQ"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="math_number" id="+lm+(l$_$,BcMq?P1c%%"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="702Ct0l!zs6,HtbKhAT;"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="qd~K,2KGT``,Qk5=L2Ko"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field></block></value><value name="TO"><block type="math_number" id="S`I(;g-TR|y%C64eydmY"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="[^#q@00stBpa$0:pt-#f"><field name="VAR" id="8[tP-gnNag|U*w*Y^_4=">Farbe°</field></block></value><value name="S"><block type="variables_get" id="6,z;zXo#*C4h)KwPOI{W"><field name="VAR" id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="F1Q@ZE3YeG7ZDB|NZkI)"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="9HO@{A:Y?+a+Y/!N6R[J"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="variables_get" id="AuAXZu#PAnd.R%;}!tlY"><field name="VAR" id="Lb]X9XmRcPagndnTyucG">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="ow7L]s$H4X|57O@gb2#v"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="S3(5ARcsl|s@Y{r:0_x+"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="qef@UewcAWFW!TP)?oC9"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="cya`+vH7WvVKaKL:8W-1"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="_fCbV+Rq~kcHsHQI352#"><next><block type="fast_led_clear" id=".`tP8|ysi7FVqWc089aH"></block></next></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="437YsL9XN%em{}Ohn3,b" x="-1509" y="306"><mutation name="Matrix in Zwischenspeicher"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6}rQk~R/q.zVpia`AA[s"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="RuG{G{%r]$$NVDOJN3x+"><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id="j]_BOu{B~_-mNoL52/^h"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="^QMtS4)|Q59[B(6OKOGv"><field name="NUM">100</field></block></value></block><block type="procedures_defnoreturn" id="}f8qz_?3-H.xNQ7IOd/=" collapsed="true" x="-697" y="309"><mutation><arg name="Dezimalcode" varid="PzJaWVHX--]9?^N_)#wn"></arg><arg name="Farbe°" varid="8[tP-gnNag|U*w*Y^_4="></arg><arg name="Sättigung %" varid="MO}nJEF/,hGyd-x(^`q+"></arg><arg name="Helligkeit %" varid="Lb]X9XmRcPagndnTyucG"></arg></mutation><field name="NAME">Matrix in Zwischenspeicher</field><statement name="STACK"><block type="variables_set" id="Z9CYP7:vA5mvz(_8z*Dt"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="variables_get" id="66/66^YY2[p`W/;*LTp)"><field name="VAR" id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</field></block></value><next><block type="flow_for" id="-`XaNw0I4204MC6.:sXL"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field><value name="FROM"><block type="math_number" id="?o*6]nP1m+MSJ74ak]o^"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="G:_N:4gCwPs6D-i0OF_;"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="/cIa1M(6yC`wziM@iQi;"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="]fIfJR#}_^i8J_53/JJ/"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field><value name="VALUE"><block type="math_single_basic" id="(kQ.?wOh[@,Ll)CNkGu#"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="GDiE4`iQV%Rem*DYnUNU"><value name="VAL1"><block type="code_pin" id="DP-Ir.`-/he_=junA([#"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="LwN/4JSj(QT.@ojxo`f$"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="edL0[5,ZbG%bIJkcDk@v"><value name="IF0"><block type="logic_compare" id="l,kR$cME#rSK~hM}@SJJ"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="ImQNOlWP4*Aoy_3!yUhE"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="math_number" id="xAAq|*@mNPL%TQ*,a]NN"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="A%!ld+#i%[!Q=-Bjy8p9"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="2PRjxeTpxt%ErDx$u6*X"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field></block></value><value name="TO"><block type="math_number" id="Onnp4^BS1]Iy-{z!`mPM"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="5dALxK|(,/_Q.7luty[W"><field name="VAR" id="8[tP-gnNag|U*w*Y^_4=">Farbe°</field></block></value><value name="S"><block type="variables_get" id="S7N[bf3;7QR`C]iGzW!5"><field name="VAR" id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="}xG0Uc9.8`kZNcO:PvYF"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="_oo_Oq7L2@7_UzC36.x;"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="variables_get" id="V!Pl2klmOXiI#`]`BXup"><field name="VAR" id="Lb]X9XmRcPagndnTyucG">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="K1S5u~KN7fG09o:@4k-_"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="S!wp|m=b2EpYo0^Z[nUK"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="@MZ8(:-MT=bCc;*%].7="><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id=",}2FU}vf,Ub.$`Xq*(6z"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement></block></next></block></statement></block><block type="set_neo_pixel" id="!Om9r{B%q#Ax%A]Do=O0" x="-1341" y="372"><value name="NUM_LEDS"><block type="math_number" id="sGg3N3FKmd)8(6;uEI{*"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="W2KAj#}-gE`P}9v*v)3B"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="9-MqZA.)f?Uo,GG(]b7X"><field name="LED">LED1</field></block></value></block></xml>

Um einen wirklich coolen Kaugummiautomaten zu bauen, kannst du mit einer Neopixel-Matrix noch Lichteffekte hinzufügen. Wie wär’s mit einer kurzen Pixel-Animation, sobald ein Kaugummi bestellt wird? Falls du eine Zählmaschine baust, kannst du die Matrix sogar nutzen, um die gezählte Anzahl, die ausgeworfen wurde, anzuzeigen. Wie Binäre Zahlen mit einer Matrix angezeigt werden, lernst du in der Verkehrszähler-Challenge.

Teste dieses Programm und lerne im Matrix-Designer, wie du weitere Lichteffekte und sogar Animationen programmierst!

Challenge:

Challenge erweitert: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="_DQjdhaJfR6,f$7cgOQ7">Position in °</variable><variable id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</variable><variable id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</variable><variable id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</variable><variable id="|H,0pDre=%.#lJkTh33Q">Tempo in %</variable><variable id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</variable><variable id="8[tP-gnNag|U*w*Y^_4=">Farbe°</variable><variable id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</variable><variable id="Lb]X9XmRcPagndnTyucG">Helligkeit %</variable><variable id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</variable><variable id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</variable><variable id="K:G4UACKdRDr(dE9O39G">Pos 1</variable><variable id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</variable><variable id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</variable><variable id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</variable></variables><block type="set_neo_pixel" id="!Om9r{B%q#Ax%A]Do=O0" x="-132" y="-131"><value name="NUM_LEDS"><block type="math_number" id="sGg3N3FKmd)8(6;uEI{*"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="W2KAj#}-gE`P}9v*v)3B"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="9-MqZA.)f?Uo,GG(]b7X"><field name="LED">LED1</field></block></value></block><block type="basic_comment" id="a8c{3fPUYGA.^d((01Ox" x="-131" y="-44"><field name="COMMENT">Kaugummiautomat mit Neopixel Matrix X-O</field></block><block type="basic_comment" id="|.$x+yKiz`j-,~[?eRLs" x="-700" y="32"><field name="COMMENT">Nicht löschen, Unterprogramme</field></block><block type="procedures_callnoreturn" id="+Dik-l#xDh27XSm4_Ez*" x="-1168" y="88"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="FuKA)24e!YPnL!6uVGNQ"><field name="NUM">0</field></block></value><value name="ARG1"><block type="led_pin" id="*N?*%c`@1TVI3UGN1p?N"><field name="LED">LED2</field></block></value></block><block type="basic_main_loop" id="9~210UV)!{|GniQxFn|[" deletable="false" x="-131" y="37"><value name="BLINK"><block type="basic_blinkcode" id="u@6%knhMhK2g(1JYw[10"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="7wwHdeF,h+(AqoJGELL0"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="Yo+C@h#~}cTlnV)Hpm9I"><field name="OP">LT</field><value name="A"><block type="sensor_read_percentage" id="oa7dSkBE|G]NJ?m2TCzt"><value name="SENSOR"><block type="sensor_pin" id="VzWiLT|x4*BdEOK}C_Z]"><field name="SENSOR">SENSOR1</field></block></value></block></value><value name="B"><block type="math_number" id="]+nqj!b;A~0%sb%F|]+e"><field name="NUM">10</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="8p[FYrS#;JRm9^08:pCC"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="dYePR2W6Y2?J#uFe+jJ("><field name="NUM">20</field></block></value><value name="ARG1"><block type="led_pin" id="jxp*@dwH|4:5jgRGl$S7"><field name="LED">LED2</field></block></value><next><block type="procedures_callnoreturn" id="@/|*oq7[[@@kcT:N(HE@"><mutation name="Leuchte Matrix"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="Lrjj;a;YLKycBqu(h/u0"><field name="NUM">27030</field></block></value><value name="ARG1"><block type="math_number" id="|taxM]BiGH)NtaC@^fkY"><field name="NUM">120</field></block></value><value name="ARG2"><block type="math_number" id="E9!3eI#h-~]Y,gCxBkbS"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="H?0{1Kg(FnI2YKY@I!m:"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="CSZE9r.(@DD[^NX~w||,"><value name="DELAY"><block type="math_number" id="r`VT^ylEIt-xntX?C5rb"><field name="NUM">500</field></block></value></block></next></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="e{rJu8qOi`idKo+c,D,f"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="4zz~d6zF/F_r_28R)3pM"><field name="NUM">80</field></block></value><value name="ARG1"><block type="led_pin" id="p`hzR%+5i]|YljP^F^0i"><field name="LED">LED2</field></block></value><next><block type="procedures_callnoreturn" id="Bd(:*:3GB}[WG7#@6B_`"><mutation name="Leuchte Matrix"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="e.!/3{:WEdFT|=Ys=SR`"><field name="NUM">38505</field></block></value><value name="ARG1"><block type="math_number" id="yf$G(;VkB1~dX(8_6R9y"><field name="NUM">0</field></block></value><value name="ARG2"><block type="math_number" id="yxqt.dXO|/UEKm!tY0H-"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="iyfVJy{nV#ctSXY+21cq"><field name="NUM">100</field></block></value></block></next></block></statement></block></statement></block><block type="procedures_defnoreturn" id="DYYovfp[/{/^ryWHZBvf" collapsed="true" x="-700" y="91"><mutation><arg name="Position in °" varid="_DQjdhaJfR6,f$7cgOQ7"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="variables_set" id="b*l`jfDpwv@_`yEQ:sQU"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="VALUE"><block type="math_map" id="wY2I~E@9)6mqH{`4}Min"><value name="VALUE"><block type="variables_get" id="sM%OH#-),/XvNLAfoDgM"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><value name="FROMLOW"><block type="math_number" id="5*[TWQi3eTy;dTNqRejO"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="3FohKj*x~t~gZ.sYtS2("><field name="NUM">180</field></block></value><value name="TOLOW"><block type="math_number" id="y+3B7BV,l3#e!tC#zP45"><field name="NUM">450</field></block></value><value name="TOHIGH"><block type="math_number" id="n[XOgoHB+-0i.,Gpwf%1"><field name="NUM">2550</field></block></value></block></value><next><block type="variables_set" id=".xsEB~Y8Qx!^%8P%)mh;"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field><value name="VALUE"><block type="math_arithmetic" id="{F9Honx#=x}}p5s6~3pd"><field name="OP">MINUS</field><value name="A"><block type="math_number" id="nN}B3!9SLvv*1{Zlf(%h"><field name="NUM">20000</field></block></value><value name="B"><block type="variables_get" id="mZbi[2Xx35m9qZ2Wz|b_"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><next><block type="flow_repeat" id="gN=t~3M0%R7Pe)/i-V4G"><value name="REPEATS"><block type="math_number" id="+qOr!,*|C9.5wJ[w,ENN"><field name="NUM">4</field></block></value><statement name="DO"><block type="led_write_state" id="6!l6z?iL+={{9KAi,H|9"><value name="LED"><block type="variables_get" id="0L`R`5_!X{Az,9F)`Qac"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="+7pwX/P2*!~K,CbqH7gH"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="Y3736,h2Aea/$FEM%mGd"><value name="DELAY_MICRO"><block type="variables_get" id=")Lg-8viw{x?GWSZtdPfK"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value><next><block type="led_write_state" id="=R-dB9$gUgUf[f1#amX?"><value name="LED"><block type="variables_get" id="L{aTSjwfCBro[60WW.0E"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value><value name="VALUE"><block type="code_pin" id="ZI?r50,S}Q!N4EWcI9rk"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="7il;NbzoR^Es7say`(zt"><value name="DELAY_MICRO"><block type="variables_get" id="|@!H=EXua/xr-NRDCr5g"><field name="VAR" id="K:G4UACKdRDr(dE9O39G">Pos 1</field></block></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="2J_{LmcNIYk{Z?kV+;::" x="-1468" y="141"><mutation name="stelle Servo sanft"><arg name="von Pos in °"></arg><arg name="bis Pos in °"></arg><arg name="Tempo in %"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="]_j_u)];;xHA8-_B3$7B"><field name="NUM">0</field></block></value><value name="ARG1"><block type="math_number" id="]W:g?fprmZ}8_8xDy2JB"><field name="NUM">160</field></block></value><value name="ARG2"><block type="math_number" id="z{3!U)]mou,t,b?*wzax"><field name="NUM">50</field></block></value><value name="ARG3"><block type="led_pin" id="wew.m#TufNiqRG~QVRLG"><field name="LED">LED2</field></block></value></block><block type="procedures_defnoreturn" id="c^Q=?l{x:FJ?Cm3Ncch(" collapsed="true" x="-701" y="146"><mutation><arg name="von Pos in °" varid="DoyC0N[TR?Wtuv+]QNjk"></arg><arg name="bis Pos in °" varid="8M|lsZfG.{JMk^B,=:P["></arg><arg name="Tempo in %" varid="|H,0pDre=%.#lJkTh33Q"></arg><arg name="Servo Pin" varid="Vw5IBG9C#Pa@r0U!+Bbh"></arg></mutation><field name="NAME">stelle Servo sanft</field><statement name="STACK"><block type="flow_for" id="MoL^$qp,s]q|#V}PCNel"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field><value name="FROM"><block type="math_number" id="V;Ieuii8?o:Tnb.0[a[N"><field name="NUM">0</field></block></value><value name="TO"><block type="math_number" id="^-^,ZT.?5jVw*o/}OAU@"><field name="NUM">3.141</field></block></value><value name="BY"><block type="math_map" id="XD^P~Qk|P($W8{5DOc}p"><value name="VALUE"><block type="variables_get" id="E?Zd6*s)DOd5/Y_5,2lM"><field name="VAR" id="|H,0pDre=%.#lJkTh33Q">Tempo in %</field></block></value><value name="FROMLOW"><block type="math_number" id="%GC=-JD8|y;:B[[f[n#U"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id=".ZWBxd~-|{*~cc2o9|q7"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="f%@Q!+NEovExdlCD_d#n"><field name="NUM">0.001</field></block></value><value name="TOHIGH"><block type="math_number" id="relQ-8H6-k~[,FEIc#HH"><field name="NUM">0.1</field></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="h,f[+#.Bb}Xe`}luH7k@"><mutation name="stelle Servo"><arg name="Position in °"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_map" id="mwXTpN_o):;]m;don~^w"><value name="VALUE"><block type="math_trig" id="*CoOOO~/KSP!ivteXph]"><field name="OP">COS</field><value name="NUM"><block type="variables_get" id="r@^JSALbD:Ryki$nBg.;"><field name="VAR" id="_DQjdhaJfR6,f$7cgOQ7">Position in °</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="{w-,lfw.uDu:8c/o=obQ"><field name="NUM">1</field></block></value><value name="FROMHIGH"><block type="math_number" id="Xa^2u$_Kn+/@4V/)o(-j"><field name="NUM">-1</field></block></value><value name="TOLOW"><block type="variables_get" id="wU4r,RDpQh@jfxg;EcxR"><field name="VAR" id="DoyC0N[TR?Wtuv+]QNjk">von Pos in °</field></block></value><value name="TOHIGH"><block type="variables_get" id="8P)Er_m+.;4yannpX11Q"><field name="VAR" id="8M|lsZfG.{JMk^B,=:P[">bis Pos in °</field></block></value></block></value><value name="ARG1"><block type="variables_get" id="$cU5xUL=@X?`I5bGb%`r"><field name="VAR" id="Vw5IBG9C#Pa@r0U!+Bbh">Servo Pin</field></block></value></block></statement></block></statement></block><block type="procedures_defreturn" id="VnG.[Xi?K@xVOSmR%A:Q" collapsed="true" x="-700" y="202"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="(YnUm|J,9fsc(p4r9s;7"><value name="LED"><block type="led_pin" id="H.T)=mm`Ifwv2Fhc|S2f"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="2?t[*AxO#`+[63!Kbv|4"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="wg)XFQj(bZQ@7;s8Xn)g"><value name="DELAY_MICRO"><block type="math_number" id="+-ylq#`F5bV2s=I1tqw5"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="^{tG^[d%-ztHVl2chmz3"><value name="LED"><block type="led_pin" id="v*lb+hhl[Wi(7pV0Rh2Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="W@AYsU^fM(0P#-M5(rD5"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="b1cIi4)J^l_l*FFQ9YDW"><value name="DELAY_MICRO"><block type="math_number" id=";%*_lC[QmT=aFvU2dBmT"><field name="NUM">10</field></block></value><next><block type="led_write_state" id=")#=atR)n~|WSuN9-h*qS"><value name="LED"><block type="led_pin" id="vt(XIF^r7P4^(:[t9(|Y"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="mC9fceq(Z!8lgrV}*q#s"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="abkprn]D|R;FJkV?c1X%"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field><value name="VALUE"><block type="code_pin" id="^l1C}Yuf?uC!$*grR2(~"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="flow_delay" id="^~$p)C+|`cXjw=]|)4vk"><value name="DELAY"><block type="math_number" id="e`),5T9$86+YFbpttWJ4"><field name="NUM">5</field></block></value><next><block type="variables_set" id="%KSHJ,gWN(m1+Bf15WL-"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="H!$n-us!:]A80ihl_Z)M"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="5jMKhuU|jo^bbm)GwQ7-"><field name="VAR" id="w#g|TWs[|tK%g)vcs!n5">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="eWh9Q^v9;dBK`FlU1YC]"><field name="NUM">0.0175</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="^0,i^h8Sw0}Qz*WLV`X{"><field name="VAR" id="Fgi(boC*F5V:]r|tcnW,">Distanz in cm</field></block></value></block><block type="procedures_callnoreturn" id="6zA*:f_gj4!Y1wAts=I:" x="-1435" y="244"><mutation name="Leuchte Matrix"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6eH}UwR355Ir_o1o}P[A"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="zhx`E`0qUks52ggh-(}="><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id="V;#@D/M5)S6m%xdKz/z+"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="!48bdi#]0mb|H[hfs:vz"><field name="NUM">100</field></block></value></block><block type="procedures_defnoreturn" id="uCP4HJbTMu0Zs76)CH^*" collapsed="true" x="-699" y="255"><mutation><arg name="Dezimalcode" varid="PzJaWVHX--]9?^N_)#wn"></arg><arg name="Farbe°" varid="8[tP-gnNag|U*w*Y^_4="></arg><arg name="Sättigung %" varid="MO}nJEF/,hGyd-x(^`q+"></arg><arg name="Helligkeit %" varid="Lb]X9XmRcPagndnTyucG"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="nh)v2ZA`5dpjzyDpQX#z"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="variables_get" id="^li}kpVfk7H3`Q_jLYoy"><field name="VAR" id="PzJaWVHX--]9?^N_)#wn">Dezimalcode</field></block></value><next><block type="flow_for" id="90kB-:lp[/3CT_350=px"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field><value name="FROM"><block type="math_number" id="*Xvn5xNcS[?2T`,~7I5q"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="~f`g9tSYD5h]Z)7?:`]4"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id=",gmTJOc!M8!inOVHJi;6"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="Up9aahxIfp[A%L`*Qnw1"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field><value name="VALUE"><block type="math_single_basic" id="/-i*-sbO:D!TU},#QTCN"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="tNQ($77tg3dW_eA{.W__"><value name="VAL1"><block type="code_pin" id="Ho#O^)5rv:^elTerYa/i"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="TIRieh|^WvQ)IOUq$fi^"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="gITwD)p3W.y@gfxR4gbG"><value name="IF0"><block type="logic_compare" id="eDcSt_#5NnU08uvz0pgk"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="!XYhs#osSAJTEADJ}6gQ"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="math_number" id="+lm+(l$_$,BcMq?P1c%%"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="702Ct0l!zs6,HtbKhAT;"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="qd~K,2KGT``,Qk5=L2Ko"><field name="VAR" id="=ym7+h@?NuGhkbw7=9_v">Bitnummer</field></block></value><value name="TO"><block type="math_number" id="S`I(;g-TR|y%C64eydmY"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="[^#q@00stBpa$0:pt-#f"><field name="VAR" id="8[tP-gnNag|U*w*Y^_4=">Farbe°</field></block></value><value name="S"><block type="variables_get" id="6,z;zXo#*C4h)KwPOI{W"><field name="VAR" id="MO}nJEF/,hGyd-x(^`q+">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="F1Q@ZE3YeG7ZDB|NZkI)"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="9HO@{A:Y?+a+Y/!N6R[J"><field name="VAR" id="BO3Cn-5z+8Y:Zu5ii*{O">Bit</field></block></value><value name="B"><block type="variables_get" id="AuAXZu#PAnd.R%;}!tlY"><field name="VAR" id="Lb]X9XmRcPagndnTyucG">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="ow7L]s$H4X|57O@gb2#v"><field name="VAR" id="XyR,!P+Ke(tQh=Y)F$j4">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="S3(5ARcsl|s@Y{r:0_x+"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="qef@UewcAWFW!TP)?oC9"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="cya`+vH7WvVKaKL:8W-1"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="_fCbV+Rq~kcHsHQI352#"><next><block type="fast_led_clear" id=".`tP8|ysi7FVqWc089aH"></block></next></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="437YsL9XN%em{}Ohn3,b" x="-1509" y="306"><mutation name="Matrix in Zwischenspeicher"><arg name="Dezimalcode"></arg><arg name="Farbe°"></arg><arg name="Sättigung %"></arg><arg name="Helligkeit %"></arg></mutation><value name="ARG0"><block type="math_number" id="6}rQk~R/q.zVpia`AA[s"><field name="NUM">1632</field></block></value><value name="ARG1"><block type="math_number" id="RuG{G{%r]$$NVDOJN3x+"><field name="NUM">250</field></block></value><value name="ARG2"><block type="math_number" id