6 – Verkehrszähler Challenge mit dem Ultraschallsensor

6

Verkehrszähler Challenge mit dem Ultraschallsensor

Das lernst du hier

Wie viele Velos sind heute in den Velokeller gefahren und wie viele wieder hinaus? Wann gehen am meisten Personen durch den Gang vor dem Schulzimmer? Wann ist der Verkehr auf einer Strasse am dichtesten? Für die Planung von Wegen, Strassen oder Gebäuden, ist es interessant zu wissen, wie viele Personen oder Fahrzeuge an einem Tag eine gewisse Stelle passieren. So können Engpässe erkannt und behoben werden.

Personenströme messen und anzeigen

Mit dieser Challenge baust du einen Verkehrszähler, mit dem du Personenströme oder anderes zählen kannst. Dank der simplen binären Anzeige auf der Matrix oder einem Neopixel Stripe, lässt sich die Anzahl sogar ohne kompliziertes Display ganz einfach ablesen.

Installiere den Zähler an einem Ort im Schulhaus, wo du die Personenströme messen möchtest. Aber bedenke: es ist gar nicht so leicht den Sensor so zu programmieren, dass er keine Doppelzählungen macht, wenn z.B. eine Person davor stehen bleibt!

Titelbild Verkehrszähler Challenge
6a

Ultraschallsensor verstehen

Wie geht das?

Ein Ultraschallsensor ist ein spezielles Messgerät, welches die Distanz zu einem Gegenstand messen kann. Obwohl der Sensor optisch an ein Augenpaar erinnert, besteht er in Wahrheit aus einem Lautsprecher und einem Mikrofon. Damit sendet er sehr hohe Töne aus und misst die Zeit, die verstreicht, bis er das Echo dieser Töne wieder hören kann. Wie das funktioniert, kann uns die Tierwelt am besten erklären, denn Fledermäuse aber auch Delphine orientieren sich mit dieser Methode in der Luft oder im Wasser.

Weitere Infos zum Ultraschallsensor und wie du ihn mit dem Arduino programmierst, findest du hier.

6b

Ultraschallsensor und Neopixel Matrix oder Neopixel Stripe anschliessen

Anschlussschema Ultraschallsensor und Neopixel Matrix
6c

Zählgerät richtig aufstellen und die binäre Anzeige verstehen

Um das Zählgerät richtig aufzustellen ist es wichtig, dass du die Logik des Programms verstehst. Ein Beispiel: Du möchtest die Personenströme in einem Korridor mit 250 cm Breite messen. Damit das geht, gilt es einen Messbereich zu bestimmen, der ein wenig kleiner ist, als der Korridor, also hier 240 cm. So bist du sicher, dass die gegenüberliegende Wand nicht vom Sensor erfasst wird.
Tritt eine Person in den Messbereich, wird sie vom Sensor erkannt, da sie nur 190 cm davon entfernt ist:
> Wenn die gemessene Distanz kleiner als 240 cm ist: erhöhe eine Zahl um 1
> Wenn die gemessene Distanz grösser als 240 cm ist: tue nichts

Grafik Messbereich beim Ultraschallsensor

Natürlich ist es möglich, ein OLED-Display über den I2C Anschluss mit dem Controller zu verbinden, um die Werte der Zählung anzuzeigen. Doch dies würde die Programmierung einiges aufwändiger machen.

Manchmal kann es daher reizvoll sein, mit dem zu arbeiten, was vorhanden ist, wie zum Beispiel einer 4×4 MATRIX. Denn damit kannst du Zahlen zwischen 0 und 65’536 leicht darstellen, obwohl das Ablesen von binären Zahlen etwas Gewöhnung erfordert 😉.

Probiere es aus, es geht so (klicke hier, um diese Grafik auszudrucken):

Mit Neopixeln binäre Zahlen anzeigen

Tipp: mit unserem MATRIX Designer kannst du die Werte online berechnen lassen, indem du eine 1 in die Tabelle einträgst!

6d

Verkehrszählung verstehen, programmieren und optimieren

Das Grundprogramm für eine Verkehrszählung ist sehr simpel und wurde schon weiter oben beschrieben. Denn immer, wenn die Distanzmessung kürzer wird, als die Breite des Messbereichs (siehe auch Grafik oben), hat ein Objekt den Bereich passiert. Um die Anzahl Objekte zu speichern, wird die Variable ANZAHL OBJEKTE um 1 erhöht.

Das funktioniert wunderbar, solange kein Objekt vor dem Sensor stehenbleibt.

Challenge:

Challenge: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</variable><variable id="w*31~?|+c#PT^JI#`;G1">Farbe°</variable><variable id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</variable><variable id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</variable><variable id="/qKL*;/x!%R,!Ovhh3ZU">1</variable><variable id="_TR;_OGyXAX;pZu;tDJf">2</variable><variable id="X8=}?3D]2x5*$N3/w!,k">3</variable><variable id="QE/jr0[0w5lKSW{oYgNL">4</variable><variable id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</variable><variable id="?K7eWV.aphZ(1PnR%k@g">FV°</variable><variable id="/0y_uI4Jv4bU)cSDh7)J">FH°</variable><variable id="-f{zBV=w=olsvW#/PEGZ">HV%</variable><variable id="Gegiis%pZIy4H8~8b)IO">HH%</variable><variable id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</variable><variable id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</variable><variable id="_7ye.we37|x%yj+NX6/w">Distanz in cm</variable><variable id="#bI4ov(rS`RxMd$x~mRD">BitNummer</variable><variable id="l9Ei[B]UF0YL`FcrA^#|">Bit</variable><variable id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</variable></variables><block type="basic_comment" id="Px[3;=!KpZjLoreb6zz;" x="229" y="-399"><field name="COMMENT">Verkehrszähler</field></block><block type="set_neo_pixel" id="bmw]#GEj(a2!6OWUx@(|" x="226" y="-333"><value name="NUM_LEDS"><block type="math_number" id=":`o#0|wMGz{4ui13Z!i["><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="?oeGzA+Ap#NUC{QOvgU("><field name="NUM">100</field></block></value><value name="OUTTURN"><block type="led_pin" id="@0xE:ifIn0bNeU*TR*/y"><field name="LED">LED1</field></block></value></block><block type="basic_comment" id="9ZF*g[_C]{MWii;muwUJ" x="-249" y="-253"><field name="COMMENT">Unterprogramme für MATRIX und Sensor</field></block><block type="basic_main_loop" id="oh{4)]E/c6ZnlvMJU:hx" deletable="false" x="226" y="-253"><value name="BLINK"><block type="basic_blinkcode" id="30Q8]G`cyw:$0tmjHjkl"><field name="SHORT">1</field><field name="LONG">1</field></block></value></block><block type="procedures_defnoreturn" id="?SfC3CIs`::YLgrXY^Z5" collapsed="true" x="-250" y="-202"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="(L(So~,eCHHb_b/3OX9A"><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="!Kfm|d)H,cKeirrOZ+M5"><field name="VAR" id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</field></block></value><next><block type="flow_for" id="8?gOhI~8@8u4l^87u-Yr"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field><value name="FROM"><block type="math_number" id="(lCd}5y!ju,P8^BmhS];"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="@BS3]9]:}F|AC@=W]XW("><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="gaY?_yHrFkqYJ~lm[F@^"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="/zOT=$D`MV0}qc`z#j$^"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field><value name="VALUE"><block type="math_single_basic" id="TP9!}zlsxKQsbZ!oJfb|"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="p%{):;Y_9HK7#H|u.tPf"><value name="VAL1"><block type="code_pin" id="{E^Qk`#Tn,9B}:Q[yYhm"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="0NE.v8P$h11vxZ!:OlN7"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="t2rZ?)EmqvWv.,w1~/e|"><value name="IF0"><block type="logic_compare" id="~)%.^y+KcD3LZC,rL[sO"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=".=d+C=|eRc0R/$Oh|)o`"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="math_number" id="hk?`,Q#+kGHuwwG[,JwL"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="$#4sOy_I,5(dy=m(cOkm"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="Uhhtqh~65_iF]Lk~*.a4"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field></block></value><value name="TO"><block type="math_number" id="sT4oR}=Ce3%o#W@wp-+S"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="nyVW[L}EH:~SZZ-_DYt9"><field name="VAR" id="w*31~?|+c#PT^JI#`;G1">Farbe°</field></block></value><value name="S"><block type="variables_get" id="TGJh[{uS|xh;sEm[,}X|"><field name="VAR" id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="!C_I~h|0MZ[+Ucm[nc1y"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="T9vL:6K=*LM^L~I3Uypk"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="variables_get" id="C5Lm0ef,_eshom*;2qot"><field name="VAR" id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="rGU1,%!=xQb.)$8CiLW["><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="uqLLj.dio)oPT}s6!,DE"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="{~?eq1#)+JA~IgcB(GP,"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="C=5L@PiuLJNsS1}*H#X$"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="C!],#6%q_KagyLso%TZg"><next><block type="fast_led_clear" id="gCE0[S7l.=s;~RHk:oqI"><next><block type="code_input" id="`)?xI_O.mMs}vJF/s)tR"><field name="CODE_INPUT">// Lerne hier, wie eine Dezimalzahl in eine Binärzahl umgewandelt wird&amp;#10;// https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=10</field></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="6$rp,+Y.vfTX,NaHq+.W" collapsed="true" x="-249" y="-155"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Speichere Matrix in Zwischenspeicher</field><statement name="STACK"><block type="variables_set" id="?y9oNjpri~$yFa.J=6V."><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="x6:e40=EZIwLaz4j{bd#"><field name="VAR" id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</field></block></value><next><block type="flow_for" id="?V(xw|0x7|u5ugnh*s/|"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field><value name="FROM"><block type="math_number" id="cncBR0?btec@:KJ:J8l9"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="bA~okUtsmIZI]|*Eh15-"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="wV^}.ppGh/7M1fqy$r]T"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="3ATJ_3KO_h%R=t@YDDyq"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field><value name="VALUE"><block type="math_single_basic" id="MDsryqn5_G4:t`yV18A-"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="x^He%ACOq*%$E%`YuGFJ"><value name="VAL1"><block type="code_pin" id="5G1xdVEvlr32BBIaye}j"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="1B%746*%s`Q_qmQE-C/="><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id=":P/w(_K{o`6=Dl2%)7(y"><value name="IF0"><block type="logic_compare" id="RLj5tF+%[!FB#_+sYF8T"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="q,;9W%/=nlIc1hf=%Fj_"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="math_number" id="d9cn7z]yT$0j1bBp{C+n"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="_rdMpDld(l/zu([)T`mx"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="j$(f@c3fQ:fQB83P[T[7"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field></block></value><value name="TO"><block type="math_number" id="$a$rKyRV$:l6*jDGvTBp"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="-VQY^!jWts!3a@3o5K:#"><field name="VAR" id="w*31~?|+c#PT^JI#`;G1">Farbe°</field></block></value><value name="S"><block type="variables_get" id="|yp|}`:Sp,FSGqV2n1G6"><field name="VAR" id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="4:Vf_aRv4etcKB{44A=%"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="mZIPfzAybt@pcXh_(hDs"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="variables_get" id="m@?RWh(,1jC`KhWo#?+n"><field name="VAR" id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="~_$ic0xVH^s]_/ty}jzx"><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="/p7$23-jN|$TOOZI)TB2"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="`Tx{7HeJxiGSj7p{Nwus"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="ulPf1p.p,K9.3*/{oWU0"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="code_input" id="_02ed-P{`s:iOb5A0^qD"><field name="CODE_INPUT">// Lerne hier, wie eine Dezimalzahl in eine Binärzahl umgewandelt wird&amp;#10;// https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=10</field></block></next></block></next></block></statement></block><block type="procedures_callnoreturn" id="|D7Q%!P]H0]FsT.8:pYa" x="230" y="-136"><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="variables_get" id="_li}dkZ:FV4`PcfP?Zn;"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="ARG1"><block type="math_number" id="vSqt,LVFZ^#Cq6Sg!5-e"><field name="NUM">25</field></block></value><value name="ARG2"><block type="math_number" id="6[-BIsVr:iDg}gQ(pS?)"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="q|H8MlNFnIE}1hM%E=OE"><field name="NUM">100</field></block></value></block><block type="procedures_defnoreturn" id="2~?vi.;+.rR/Lo^Ss;oc" collapsed="true" x="-249" y="-110"><mutation><arg name="1" varid="/qKL*;/x!%R,!Ovhh3ZU"></arg><arg name="2" varid="_TR;_OGyXAX;pZu;tDJf"></arg><arg name="3" varid="X8=}?3D]2x5*$N3/w!,k"></arg><arg name="4" varid="QE/jr0[0w5lKSW{oYgNL"></arg><arg name="Tempo ms" varid="ATZ]^Dr%JzgVl(W,w9RE"></arg><arg name="FV°" varid="?K7eWV.aphZ(1PnR%k@g"></arg><arg name="FH°" varid="/0y_uI4Jv4bU)cSDh7)J"></arg><arg name="HV%" varid="-f{zBV=w=olsvW#/PEGZ"></arg><arg name="HH%" varid="Gegiis%pZIy4H8~8b)IO"></arg></mutation><field name="NAME">Leuchte Animation</field><statement name="STACK"><block type="set_pixel_color" id="j.T}l0y2IkJcjQ3X?8C("><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="4Z9YjZOk!3w([+b2OZJ2"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="n]{(sq0jRF1?|gQK+mTG"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id=".i[q0%-VK$`i)xZWzMG]"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="ju5Cl)(x5}L6H~JKnrt+"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="EN//9MUQIKn0-U5Ol=d%"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="x.[+RdA(*n-du0xqJ_0z"><mutation name="Speichere 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="variables_get" id="^vv;Rc7^BnaD2^]jLSo;"><field name="VAR" id="/qKL*;/x!%R,!Ovhh3ZU">1</field></block></value><value name="ARG1"><block type="variables_get" id="ey%ZNsrR$EQJ;FHT-UZ_"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="QA9sfiigN3o=XYJa:O?w"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="S1VOf|)Wb;pV|W8Q,MGK"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="KqWQH@K_n2jX+~IFerFc"><next><block type="logic_if" id="QU:XnpF[HS,SY7%+#!/%"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="*+Rj=qi|dw)ysh.-%C=,"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=":Z_l?uc_C4ERn|M_,C#K"><field name="VAR" id="/qKL*;/x!%R,!Ovhh3ZU">1</field></block></value><value name="B"><block type="math_number" id="hC=$oCiLpG[ZsB@d53Y~"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="qCGcnIl)9V?Yvo,s%GY1"><value name="DELAY"><block type="variables_get" id="iWp-AxU;^+w_*ryrYvSZ"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="a#aJl5xEbHa3BpeX2g)Q"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="`kk7cin#bu4CV)9e]AY+"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="$ZbzfeX`KcK4@!g!0$~7"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="Jz!ck1ta,_8sTk;Zr(_^"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="`}q)jggpDy]St{EJ_9D."><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="]4,l%tvX!0,=CO{r1x*g"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="g,XT1axi%;TSyOzXeov("><mutation name="Speichere 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="variables_get" id="$i.tqgFcz+/sHly=SJvZ"><field name="VAR" id="_TR;_OGyXAX;pZu;tDJf">2</field></block></value><value name="ARG1"><block type="variables_get" id="3Ct/_!.V=,*/EI!/D3pf"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="EB+Ga%c+RRj8%$Qn-v0m"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="^1yo-JZ%E{w-6luLgI@7"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id=":;5l]Wu@-D/LksS#`Qia"><next><block type="logic_if" id="|aNH!5]0B!@8ANO9-N3}"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="fN3kE`liSZ;5zY$5~t[%"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="tG=KnlUMGxIGgc/*P+{K"><field name="VAR" id="_TR;_OGyXAX;pZu;tDJf">2</field></block></value><value name="B"><block type="math_number" id="#FL9,9T[KC|JUPCe%xx."><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="!jtg/+qHMO.[7xDA,8%+"><value name="DELAY"><block type="variables_get" id="l2qsyAyJEls{YkA_Zs4P"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="AW7^3ZZgsSFt3H^%gCw^"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="u.87N3sZceOZi6E6!6pz"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="u|Ok^so8HySs0iNxxKs8"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="rX]+L^eeY/bXvpeOpd9p"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="YaqUu!CL^vzX9YtxEb+W"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="`AU;T$p.AsQMB3UB2g/q"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="HMev=9FHKyJ%14Y?{sO1"><mutation name="Speichere 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="variables_get" id="iG@=8@VDuzb*]`E,9cjQ"><field name="VAR" id="X8=}?3D]2x5*$N3/w!,k">3</field></block></value><value name="ARG1"><block type="variables_get" id="*`]^tzI$Pl^P@)uJI0mJ"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="]H=$ULoQ;5R}fnb%A9^#"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="KY}HkMO4D:t@61gAA%1="><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="@nT_WSlY`q^eIq[i5%NK"><next><block type="logic_if" id="{BK.V(g6w@9[rz=;RtIB"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="kC~=Qk%H~08xetx!Tr--"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="}t/:mj0Wr(.=LcP/1IkV"><field name="VAR" id="X8=}?3D]2x5*$N3/w!,k">3</field></block></value><value name="B"><block type="math_number" id="QT-_o;{h!YSnLvFca^|V"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="|yY^F2gUhdbS,x?AzHoR"><value name="DELAY"><block type="variables_get" id="[K[}3DqWVb}NeTmbg|2%"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="DaXXVX#N}LW@jg)p;zzz"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id=";/5m8-DhHUg2~31ng!R?"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id=":6Tq.6Y%)XdxA[uGSzg:"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="M,Z2Q/M4;kU}+V@1BDGU"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="54uu6y~0-sssfuJb2x`o"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="]XL`aWJig?8HW[1WbO1u"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="kq~Kq(gIbM!X*@VxG)wH"><mutation name="Speichere 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="variables_get" id="4sV4kZ+gjLCo5UJSb3r("><field name="VAR" id="QE/jr0[0w5lKSW{oYgNL">4</field></block></value><value name="ARG1"><block type="variables_get" id="ZEbb@GVtW27T];{Xb-nK"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="Y=~4{=%(=mXBNN1hD^MV"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="V!qCf+K^9.c.Nra)3:Ct"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="SH+foN.vEP*zWfzH4P*A"><next><block type="logic_if" id="a*S`R)G$?knkPgcQ`|sM"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="x?GvH?5o^]mZ,~^H(|VP"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="niTuT0N}Q_3.)82e#)#N"><field name="VAR" id="QE/jr0[0w5lKSW{oYgNL">4</field></block></value><value name="B"><block type="math_number" id="8gnM8Ss9ZnZ37t7%mC$4"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="8!@WHQC^[-gKehLdzD$q"><value name="DELAY"><block type="variables_get" id="8y^38y+WpV8Ug{_Wjm0u"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defreturn" id="TBvQ8Sr=*[TcvQX9^5_J" collapsed="true" x="-250" y="-66"><field name="NAME">gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="(kj]~+1/ZFD0US:vu-*9"><value name="LED"><block type="led_pin" id="blZ0%tdcGI]JLQip1_RQ"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="orLh,)iv},r24Zs2+}!#"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="S[MmRI*@Hj1i}YC.[rd5"><value name="DELAY_MICRO"><block type="math_number" id="OfzdI8hp.c(%SdaI?}ZS"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="@eZs~I(SS/:jD496}g@*"><value name="LED"><block type="led_pin" id="(qbN4yE{@?e;ClO[#jz6"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="bizQ^Ka}3DZRPxWw,0j$"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="-M=T~=Td6N9}!+hC;0]w"><value name="DELAY_MICRO"><block type="math_number" id="]fZ#|4D9|QJ4PEuFZs[t"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="C%X#}aI^]Ta^@KcET+;4"><value name="LED"><block type="led_pin" id="MUPm9sh#.CL84)SL.1;!"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="2f1)Vqr@ka]N!?t(^wxZ"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="[qW|t_GpnW%[y%5AaYUg"><field name="VAR" id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</field><value name="VALUE"><block type="code_pin" id="H#gT/;^m5CrQnF{WR+;7"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="flow_delay" id="DtnZ=25C5}TF/#xX76dt"><value name="DELAY"><block type="math_number" id="7K*/gT%E4s.Q0MZfo#[y"><field name="NUM">5</field></block></value><next><block type="variables_set" id="vFnXw[RWuqq].BUHDP8F"><field name="VAR" id="_7ye.we37|x%yj+NX6/w">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="C^:rK;^{hCcCj[)_(~F~"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="p{xFK*5^^0eAI9rI,WPg"><field name="VAR" id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="qr^Qq],Bj1urc3sL=eX}"><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=")r}C!FTab-Y:c^j2$u!#"><field name="VAR" id="_7ye.we37|x%yj+NX6/w">Distanz in cm</field></block></value></block><block type="logic_compare" id="|DtGJ$g13U9[;qf~-^bR" x="227" y="-59"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="CT=:v;zFr}rF`N]V~xoY"><mutation name="gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="sncrNOx=kezY(|p0j#pf"><field name="NUM">240</field></block></value></block><block type="basic_comment" id="H1zy}oQyN]:W1}F@nqPL" x="552" y="-53"><field name="COMMENT">Trage hier die Breite deines Messbereichs ein</field></block><block type="variables_set" id="?w@_ER5RqS{X)/_uvR{{" x="231" y="17"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field><value name="VALUE"><block type="math_arithmetic" id="=.)TbjyORoXp0gu)Vd%K"><field name="OP">ADD</field><value name="A"><block type="variables_get" id="mIwrbsZ@ZXAaYW*9hCeV"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="B"><block type="math_number" id="XE35Z1ih8@xb1o[^,^it"><field name="NUM">1</field></block></value></block></value></block><block type="logic_if" id="_qx5{,=1kqlPJ?1J}fa9" x="234" y="103"></block><block type="basic_comment" id="lOLye:EdB@KB/2QSJx`9" x="428" y="103"><field name="COMMENT">Diese Pause verhindert Mehrfachmessungen. Wo gehört sie hin?</field></block><block type="flow_delay" id="YHn75cYV}nu]Q[}?SxaB" x="430" y="149"><value name="DELAY"><block type="math_number" id="+2Xrl=DN_g;g[G_pwv9k"><field name="NUM">1000</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="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</variable><variable id="w*31~?|+c#PT^JI#`;G1">Farbe°</variable><variable id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</variable><variable id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</variable><variable id="/qKL*;/x!%R,!Ovhh3ZU">1</variable><variable id="_TR;_OGyXAX;pZu;tDJf">2</variable><variable id="X8=}?3D]2x5*$N3/w!,k">3</variable><variable id="QE/jr0[0w5lKSW{oYgNL">4</variable><variable id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</variable><variable id="?K7eWV.aphZ(1PnR%k@g">FV°</variable><variable id="/0y_uI4Jv4bU)cSDh7)J">FH°</variable><variable id="-f{zBV=w=olsvW#/PEGZ">HV%</variable><variable id="Gegiis%pZIy4H8~8b)IO">HH%</variable><variable id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</variable><variable id="_7ye.we37|x%yj+NX6/w">Distanz in cm</variable><variable id="#bI4ov(rS`RxMd$x~mRD">BitNummer</variable><variable id="l9Ei[B]UF0YL`FcrA^#|">Bit</variable><variable id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</variable><variable id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</variable></variables><block type="basic_comment" id="Px[3;=!KpZjLoreb6zz;" x="229" y="-399"><field name="COMMENT">Verkehrszähler</field></block><block type="set_neo_pixel" id="bmw]#GEj(a2!6OWUx@(|" x="226" y="-333"><value name="NUM_LEDS"><block type="math_number" id=":`o#0|wMGz{4ui13Z!i["><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="?oeGzA+Ap#NUC{QOvgU("><field name="NUM">100</field></block></value><value name="OUTTURN"><block type="led_pin" id="@0xE:ifIn0bNeU*TR*/y"><field name="LED">LED1</field></block></value></block><block type="basic_comment" id="9ZF*g[_C]{MWii;muwUJ" x="-249" y="-253"><field name="COMMENT">Unterprogramme für MATRIX und Sensor</field></block><block type="basic_main_loop" id="oh{4)]E/c6ZnlvMJU:hx" deletable="false" x="227" y="-254"><value name="BLINK"><block type="basic_blinkcode" id="30Q8]G`cyw:$0tmjHjkl"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="_qx5{,=1kqlPJ?1J}fa9"><value name="IF0"><block type="logic_compare" id="|DtGJ$g13U9[;qf~-^bR"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="CT=:v;zFr}rF`N]V~xoY"><mutation name="gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="sncrNOx=kezY(|p0j#pf"><field name="NUM">240</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="e^$bQKHKXFBhK1kh9j6A"><field name="MODE">MODE1</field><value name="FROM"><block type="math_number" id="2}^dg^mIHpRxR?(VuNgF"><field name="NUM">16</field></block></value><value name="TO"><block type="math_number" id="y-a^bhiihQk=3+kcyh1,"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="j|k94Fv4tv(jQ9,c?f_!"><field name="NUM">120</field></block></value><value name="S"><block type="math_number" id="F=v/M$/wX}J=4}1/c(Fr"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="ub77?Sy^:D:#uF14ocs%"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="Fwtk/wimtEX+4G$!u`9K"><value name="DELAY"><block type="math_number" id="R+?d`:;H-:EIxY0mbDts"><field name="NUM">200</field></block></value><next><block type="set_pixel_color" id="P_x1v0_h}@2`MnoZZtW4"><field name="MODE">MODE1</field><value name="FROM"><block type="math_number" id="0aBBglfXf`Vq.c:tkvsS"><field name="NUM">16</field></block></value><value name="TO"><block type="math_number" id="wd47qZ9f-GA13Yn{D-(O"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="TM[[}bZf705Csca8wZ3$"><field name="NUM">120</field></block></value><value name="S"><block type="math_number" id="jAz%n#kxfH7v-.d*7l_h"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="}e2r=9uuHS(xvkHvlKjy"><field name="NUM">100</field></block></value><next><block type="variables_set" id="?w@_ER5RqS{X)/_uvR{{"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field><value name="VALUE"><block type="math_arithmetic" id="=.)TbjyORoXp0gu)Vd%K"><field name="OP">ADD</field><value name="A"><block type="variables_get" id="mIwrbsZ@ZXAaYW*9hCeV"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="B"><block type="math_number" id="XE35Z1ih8@xb1o[^,^it"><field name="NUM">1</field></block></value></block></value><next><block type="procedures_callnoreturn" id="|D7Q%!P]H0]FsT.8:pYa"><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="variables_get" id="_li}dkZ:FV4`PcfP?Zn;"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="ARG1"><block type="math_number" id="vSqt,LVFZ^#Cq6Sg!5-e"><field name="NUM">25</field></block></value><value name="ARG2"><block type="math_number" id="6[-BIsVr:iDg}gQ(pS?)"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="q|H8MlNFnIE}1hM%E=OE"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="YHn75cYV}nu]Q[}?SxaB"><value name="DELAY"><block type="math_number" id="+2Xrl=DN_g;g[G_pwv9k"><field name="NUM">1000</field></block></value></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement></block><block type="procedures_defnoreturn" id="?SfC3CIs`::YLgrXY^Z5" collapsed="true" x="-250" y="-202"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="(L(So~,eCHHb_b/3OX9A"><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="!Kfm|d)H,cKeirrOZ+M5"><field name="VAR" id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</field></block></value><next><block type="flow_for" id="8?gOhI~8@8u4l^87u-Yr"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field><value name="FROM"><block type="math_number" id="(lCd}5y!ju,P8^BmhS];"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="@BS3]9]:}F|AC@=W]XW("><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="gaY?_yHrFkqYJ~lm[F@^"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="/zOT=$D`MV0}qc`z#j$^"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field><value name="VALUE"><block type="math_single_basic" id="TP9!}zlsxKQsbZ!oJfb|"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="p%{):;Y_9HK7#H|u.tPf"><value name="VAL1"><block type="code_pin" id="{E^Qk`#Tn,9B}:Q[yYhm"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="0NE.v8P$h11vxZ!:OlN7"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="t2rZ?)EmqvWv.,w1~/e|"><value name="IF0"><block type="logic_compare" id="~)%.^y+KcD3LZC,rL[sO"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=".=d+C=|eRc0R/$Oh|)o`"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="math_number" id="hk?`,Q#+kGHuwwG[,JwL"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="$#4sOy_I,5(dy=m(cOkm"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="Uhhtqh~65_iF]Lk~*.a4"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field></block></value><value name="TO"><block type="math_number" id="sT4oR}=Ce3%o#W@wp-+S"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="nyVW[L}EH:~SZZ-_DYt9"><field name="VAR" id="w*31~?|+c#PT^JI#`;G1">Farbe°</field></block></value><value name="S"><block type="variables_get" id="TGJh[{uS|xh;sEm[,}X|"><field name="VAR" id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="!C_I~h|0MZ[+Ucm[nc1y"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="T9vL:6K=*LM^L~I3Uypk"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="variables_get" id="C5Lm0ef,_eshom*;2qot"><field name="VAR" id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="rGU1,%!=xQb.)$8CiLW["><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="uqLLj.dio)oPT}s6!,DE"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="{~?eq1#)+JA~IgcB(GP,"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="C=5L@PiuLJNsS1}*H#X$"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="C!],#6%q_KagyLso%TZg"><next><block type="fast_led_clear" id="gCE0[S7l.=s;~RHk:oqI"><next><block type="code_input" id="`)?xI_O.mMs}vJF/s)tR"><field name="CODE_INPUT">// Lerne hier, wie eine Dezimalzahl in eine Binärzahl umgewandelt wird&amp;#10;// https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=10</field></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="H1zy}oQyN]:W1}F@nqPL" x="647" y="-218"><field name="COMMENT">Trage hier die Breite deines Messbereichs ein</field></block><block type="basic_comment" id="62p_ubUI?wnl;2-1UKj`" x="59" y="-176"><field name="COMMENT">Wozu sind diese Pixel?</field></block><block type="procedures_defnoreturn" id="6$rp,+Y.vfTX,NaHq+.W" collapsed="true" x="-249" y="-155"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Speichere Matrix in Zwischenspeicher</field><statement name="STACK"><block type="variables_set" id="?y9oNjpri~$yFa.J=6V."><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="x6:e40=EZIwLaz4j{bd#"><field name="VAR" id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</field></block></value><next><block type="flow_for" id="?V(xw|0x7|u5ugnh*s/|"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field><value name="FROM"><block type="math_number" id="cncBR0?btec@:KJ:J8l9"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="bA~okUtsmIZI]|*Eh15-"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="wV^}.ppGh/7M1fqy$r]T"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="3ATJ_3KO_h%R=t@YDDyq"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field><value name="VALUE"><block type="math_single_basic" id="MDsryqn5_G4:t`yV18A-"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="x^He%ACOq*%$E%`YuGFJ"><value name="VAL1"><block type="code_pin" id="5G1xdVEvlr32BBIaye}j"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="1B%746*%s`Q_qmQE-C/="><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id=":P/w(_K{o`6=Dl2%)7(y"><value name="IF0"><block type="logic_compare" id="RLj5tF+%[!FB#_+sYF8T"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="q,;9W%/=nlIc1hf=%Fj_"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="math_number" id="d9cn7z]yT$0j1bBp{C+n"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="_rdMpDld(l/zu([)T`mx"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="j$(f@c3fQ:fQB83P[T[7"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field></block></value><value name="TO"><block type="math_number" id="$a$rKyRV$:l6*jDGvTBp"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="-VQY^!jWts!3a@3o5K:#"><field name="VAR" id="w*31~?|+c#PT^JI#`;G1">Farbe°</field></block></value><value name="S"><block type="variables_get" id="|yp|}`:Sp,FSGqV2n1G6"><field name="VAR" id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="4:Vf_aRv4etcKB{44A=%"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="mZIPfzAybt@pcXh_(hDs"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="variables_get" id="m@?RWh(,1jC`KhWo#?+n"><field name="VAR" id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="~_$ic0xVH^s]_/ty}jzx"><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="/p7$23-jN|$TOOZI)TB2"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="`Tx{7HeJxiGSj7p{Nwus"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="ulPf1p.p,K9.3*/{oWU0"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="code_input" id="_02ed-P{`s:iOb5A0^qD"><field name="CODE_INPUT">// Lerne hier, wie eine Dezimalzahl in eine Binärzahl umgewandelt wird&amp;#10;// https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=10</field></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="2~?vi.;+.rR/Lo^Ss;oc" collapsed="true" x="-249" y="-110"><mutation><arg name="1" varid="/qKL*;/x!%R,!Ovhh3ZU"></arg><arg name="2" varid="_TR;_OGyXAX;pZu;tDJf"></arg><arg name="3" varid="X8=}?3D]2x5*$N3/w!,k"></arg><arg name="4" varid="QE/jr0[0w5lKSW{oYgNL"></arg><arg name="Tempo ms" varid="ATZ]^Dr%JzgVl(W,w9RE"></arg><arg name="FV°" varid="?K7eWV.aphZ(1PnR%k@g"></arg><arg name="FH°" varid="/0y_uI4Jv4bU)cSDh7)J"></arg><arg name="HV%" varid="-f{zBV=w=olsvW#/PEGZ"></arg><arg name="HH%" varid="Gegiis%pZIy4H8~8b)IO"></arg></mutation><field name="NAME">Leuchte Animation</field><statement name="STACK"><block type="set_pixel_color" id="j.T}l0y2IkJcjQ3X?8C("><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="4Z9YjZOk!3w([+b2OZJ2"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="n]{(sq0jRF1?|gQK+mTG"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id=".i[q0%-VK$`i)xZWzMG]"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="ju5Cl)(x5}L6H~JKnrt+"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="EN//9MUQIKn0-U5Ol=d%"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="x.[+RdA(*n-du0xqJ_0z"><mutation name="Speichere 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="variables_get" id="^vv;Rc7^BnaD2^]jLSo;"><field name="VAR" id="/qKL*;/x!%R,!Ovhh3ZU">1</field></block></value><value name="ARG1"><block type="variables_get" id="ey%ZNsrR$EQJ;FHT-UZ_"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="QA9sfiigN3o=XYJa:O?w"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="S1VOf|)Wb;pV|W8Q,MGK"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="KqWQH@K_n2jX+~IFerFc"><next><block type="logic_if" id="QU:XnpF[HS,SY7%+#!/%"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="*+Rj=qi|dw)ysh.-%C=,"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=":Z_l?uc_C4ERn|M_,C#K"><field name="VAR" id="/qKL*;/x!%R,!Ovhh3ZU">1</field></block></value><value name="B"><block type="math_number" id="hC=$oCiLpG[ZsB@d53Y~"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="qCGcnIl)9V?Yvo,s%GY1"><value name="DELAY"><block type="variables_get" id="iWp-AxU;^+w_*ryrYvSZ"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="a#aJl5xEbHa3BpeX2g)Q"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="`kk7cin#bu4CV)9e]AY+"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="$ZbzfeX`KcK4@!g!0$~7"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="Jz!ck1ta,_8sTk;Zr(_^"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="`}q)jggpDy]St{EJ_9D."><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="]4,l%tvX!0,=CO{r1x*g"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="g,XT1axi%;TSyOzXeov("><mutation name="Speichere 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="variables_get" id="$i.tqgFcz+/sHly=SJvZ"><field name="VAR" id="_TR;_OGyXAX;pZu;tDJf">2</field></block></value><value name="ARG1"><block type="variables_get" id="3Ct/_!.V=,*/EI!/D3pf"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="EB+Ga%c+RRj8%$Qn-v0m"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="^1yo-JZ%E{w-6luLgI@7"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id=":;5l]Wu@-D/LksS#`Qia"><next><block type="logic_if" id="|aNH!5]0B!@8ANO9-N3}"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="fN3kE`liSZ;5zY$5~t[%"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="tG=KnlUMGxIGgc/*P+{K"><field name="VAR" id="_TR;_OGyXAX;pZu;tDJf">2</field></block></value><value name="B"><block type="math_number" id="#FL9,9T[KC|JUPCe%xx."><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="!jtg/+qHMO.[7xDA,8%+"><value name="DELAY"><block type="variables_get" id="l2qsyAyJEls{YkA_Zs4P"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="AW7^3ZZgsSFt3H^%gCw^"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="u.87N3sZceOZi6E6!6pz"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="u|Ok^so8HySs0iNxxKs8"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="rX]+L^eeY/bXvpeOpd9p"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="YaqUu!CL^vzX9YtxEb+W"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="`AU;T$p.AsQMB3UB2g/q"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="HMev=9FHKyJ%14Y?{sO1"><mutation name="Speichere 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="variables_get" id="iG@=8@VDuzb*]`E,9cjQ"><field name="VAR" id="X8=}?3D]2x5*$N3/w!,k">3</field></block></value><value name="ARG1"><block type="variables_get" id="*`]^tzI$Pl^P@)uJI0mJ"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="]H=$ULoQ;5R}fnb%A9^#"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="KY}HkMO4D:t@61gAA%1="><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="@nT_WSlY`q^eIq[i5%NK"><next><block type="logic_if" id="{BK.V(g6w@9[rz=;RtIB"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="kC~=Qk%H~08xetx!Tr--"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="}t/:mj0Wr(.=LcP/1IkV"><field name="VAR" id="X8=}?3D]2x5*$N3/w!,k">3</field></block></value><value name="B"><block type="math_number" id="QT-_o;{h!YSnLvFca^|V"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="|yY^F2gUhdbS,x?AzHoR"><value name="DELAY"><block type="variables_get" id="[K[}3DqWVb}NeTmbg|2%"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement><next><block type="set_pixel_color" id="DaXXVX#N}LW@jg)p;zzz"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id=";/5m8-DhHUg2~31ng!R?"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id=":6Tq.6Y%)XdxA[uGSzg:"><field name="NUM">16</field></block></value><value name="H"><block type="variables_get" id="M,Z2Q/M4;kU}+V@1BDGU"><field name="VAR" id="/0y_uI4Jv4bU)cSDh7)J">FH°</field></block></value><value name="S"><block type="math_number" id="54uu6y~0-sssfuJb2x`o"><field name="NUM">100</field></block></value><value name="B"><block type="variables_get" id="]XL`aWJig?8HW[1WbO1u"><field name="VAR" id="Gegiis%pZIy4H8~8b)IO">HH%</field></block></value><next><block type="procedures_callnoreturn" id="kq~Kq(gIbM!X*@VxG)wH"><mutation name="Speichere 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="variables_get" id="4sV4kZ+gjLCo5UJSb3r("><field name="VAR" id="QE/jr0[0w5lKSW{oYgNL">4</field></block></value><value name="ARG1"><block type="variables_get" id="ZEbb@GVtW27T];{Xb-nK"><field name="VAR" id="?K7eWV.aphZ(1PnR%k@g">FV°</field></block></value><value name="ARG2"><block type="math_number" id="Y=~4{=%(=mXBNN1hD^MV"><field name="NUM">100</field></block></value><value name="ARG3"><block type="variables_get" id="V!qCf+K^9.c.Nra)3:Ct"><field name="VAR" id="-f{zBV=w=olsvW#/PEGZ">HV%</field></block></value><next><block type="fast_led" id="SH+foN.vEP*zWfzH4P*A"><next><block type="logic_if" id="a*S`R)G$?knkPgcQ`|sM"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="x?GvH?5o^]mZ,~^H(|VP"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="niTuT0N}Q_3.)82e#)#N"><field name="VAR" id="QE/jr0[0w5lKSW{oYgNL">4</field></block></value><value name="B"><block type="math_number" id="8gnM8Ss9ZnZ37t7%mC$4"><field name="NUM">0</field></block></value></block></value><statement name="ELSE"><block type="flow_delay" id="8!@WHQC^[-gKehLdzD$q"><value name="DELAY"><block type="variables_get" id="8y^38y+WpV8Ug{_Wjm0u"><field name="VAR" id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defreturn" id="TBvQ8Sr=*[TcvQX9^5_J" collapsed="true" x="-250" y="-66"><field name="NAME">gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="(kj]~+1/ZFD0US:vu-*9"><value name="LED"><block type="led_pin" id="blZ0%tdcGI]JLQip1_RQ"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="orLh,)iv},r24Zs2+}!#"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="S[MmRI*@Hj1i}YC.[rd5"><value name="DELAY_MICRO"><block type="math_number" id="OfzdI8hp.c(%SdaI?}ZS"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="@eZs~I(SS/:jD496}g@*"><value name="LED"><block type="led_pin" id="(qbN4yE{@?e;ClO[#jz6"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="bizQ^Ka}3DZRPxWw,0j$"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="-M=T~=Td6N9}!+hC;0]w"><value name="DELAY_MICRO"><block type="math_number" id="]fZ#|4D9|QJ4PEuFZs[t"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="C%X#}aI^]Ta^@KcET+;4"><value name="LED"><block type="led_pin" id="MUPm9sh#.CL84)SL.1;!"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="2f1)Vqr@ka]N!?t(^wxZ"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="[qW|t_GpnW%[y%5AaYUg"><field name="VAR" id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</field><value name="VALUE"><block type="code_pin" id="H#gT/;^m5CrQnF{WR+;7"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="flow_delay" id="DtnZ=25C5}TF/#xX76dt"><value name="DELAY"><block type="math_number" id="7K*/gT%E4s.Q0MZfo#[y"><field name="NUM">5</field></block></value><next><block type="variables_set" id="vFnXw[RWuqq].BUHDP8F"><field name="VAR" id="_7ye.we37|x%yj+NX6/w">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="C^:rK;^{hCcCj[)_(~F~"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="p{xFK*5^^0eAI9rI,WPg"><field name="VAR" id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="qr^Qq],Bj1urc3sL=eX}"><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=")r}C!FTab-Y:c^j2$u!#"><field name="VAR" id="_7ye.we37|x%yj+NX6/w">Distanz in cm</field></block></value></block><block type="basic_comment" id="lOLye:EdB@KB/2QSJx`9" x="456" y="28"><field name="COMMENT">Diese Pause verhindert Mehrfachmessungen. Experimentiere mit der Länge</field></block></xml>

Wie oben beschrieben, kann dieser Sketch nicht erkennen, ob ein Objekt vor dem Sensor stehen geblieben ist. Erweitere deinen Code so, dass dies möglich wird!

Challenge erweitert:

Challenge erweitert: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</variable><variable id="w*31~?|+c#PT^JI#`;G1">Farbe°</variable><variable id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</variable><variable id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</variable><variable id="/qKL*;/x!%R,!Ovhh3ZU">1</variable><variable id="_TR;_OGyXAX;pZu;tDJf">2</variable><variable id="X8=}?3D]2x5*$N3/w!,k">3</variable><variable id="QE/jr0[0w5lKSW{oYgNL">4</variable><variable id="ATZ]^Dr%JzgVl(W,w9RE">Tempo ms</variable><variable id="?K7eWV.aphZ(1PnR%k@g">FV°</variable><variable id="/0y_uI4Jv4bU)cSDh7)J">FH°</variable><variable id="-f{zBV=w=olsvW#/PEGZ">HV%</variable><variable id="Gegiis%pZIy4H8~8b)IO">HH%</variable><variable id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</variable><variable id="_7ye.we37|x%yj+NX6/w">Distanz in cm</variable><variable id="#bI4ov(rS`RxMd$x~mRD">BitNummer</variable><variable id="l9Ei[B]UF0YL`FcrA^#|">Bit</variable><variable id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</variable><variable id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</variable></variables><block type="basic_comment" id="Px[3;=!KpZjLoreb6zz;" x="229" y="-399"><field name="COMMENT">Verkehrszähler</field></block><block type="set_neo_pixel" id="bmw]#GEj(a2!6OWUx@(|" x="226" y="-333"><value name="NUM_LEDS"><block type="math_number" id=":`o#0|wMGz{4ui13Z!i["><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="?oeGzA+Ap#NUC{QOvgU("><field name="NUM">100</field></block></value><value name="OUTTURN"><block type="led_pin" id="@0xE:ifIn0bNeU*TR*/y"><field name="LED">LED1</field></block></value></block><block type="basic_comment" id="9ZF*g[_C]{MWii;muwUJ" x="-249" y="-253"><field name="COMMENT">Unterprogramme für MATRIX und Sensor</field></block><block type="basic_main_loop" id="oh{4)]E/c6ZnlvMJU:hx" deletable="false" x="226" y="-253"><value name="BLINK"><block type="basic_blinkcode" id="30Q8]G`cyw:$0tmjHjkl"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="_qx5{,=1kqlPJ?1J}fa9"><value name="IF0"><block type="logic_compare" id="|DtGJ$g13U9[;qf~-^bR"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="CT=:v;zFr}rF`N]V~xoY"><mutation name="gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="sncrNOx=kezY(|p0j#pf"><field name="NUM">240</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="dV26R]x0H7~qyH1vwT;^"><field name="MODE">MODE1</field><value name="FROM"><block type="math_number" id="xJK1D*kkLhVK,[91|!I%"><field name="NUM">16</field></block></value><value name="TO"><block type="math_number" id="TZlkOlCN9SK41Bke|x1J"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="S3^h4)rcuM3!,0M3)BH2"><field name="NUM">120</field></block></value><value name="S"><block type="math_number" id="gbg|A!CcdiG[51bq}0k["><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="Mrd]R?Nx:x~SMjG*/K%^"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="_nPP$`2l%wu.Y+8S7Osx"><value name="DELAY"><block type="math_number" id="?Vr/o/$GO{2d0Gq?,.z}"><field name="NUM">200</field></block></value><next><block type="set_pixel_color" id="a+]GEJ+7]1IICUn=3?P|"><field name="MODE">MODE1</field><value name="FROM"><block type="math_number" id="d].F5:nwV/x?|-F(Ce1D"><field name="NUM">16</field></block></value><value name="TO"><block type="math_number" id="-KFve}km_~~MYU+Z?VuW"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="P{?;gE=hgAw]BbUK_T1h"><field name="NUM">120</field></block></value><value name="S"><block type="math_number" id="CD,,p3H4T1@w]YA7BH4L"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="e}q=B+g}oN+%m-bOPBZc"><field name="NUM">0</field></block></value><next><block type="variables_set" id="?w@_ER5RqS{X)/_uvR{{"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field><value name="VALUE"><block type="math_arithmetic" id="=.)TbjyORoXp0gu)Vd%K"><field name="OP">ADD</field><value name="A"><block type="variables_get" id="mIwrbsZ@ZXAaYW*9hCeV"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="B"><block type="math_number" id="XE35Z1ih8@xb1o[^,^it"><field name="NUM">1</field></block></value></block></value><next><block type="procedures_callnoreturn" id="|D7Q%!P]H0]FsT.8:pYa"><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="variables_get" id="_li}dkZ:FV4`PcfP?Zn;"><field name="VAR" id="+F6{Q,$1$Py;SN7[,gT;">Anzahl Objekte</field></block></value><value name="ARG1"><block type="math_number" id="vSqt,LVFZ^#Cq6Sg!5-e"><field name="NUM">25</field></block></value><value name="ARG2"><block type="math_number" id="6[-BIsVr:iDg}gQ(pS?)"><field name="NUM">100</field></block></value><value name="ARG3"><block type="math_number" id="q|H8MlNFnIE}1hM%E=OE"><field name="NUM">100</field></block></value></block></next></block></next></block></next></block></next></block></statement><next><block type="flow_delay" id="*qd`sX!/#2{=mYt/r[#D"><value name="DELAY"><block type="math_number" id="$xUezVce,,(D9`:8FZrh"><field name="NUM">200</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="?SfC3CIs`::YLgrXY^Z5" collapsed="true" x="-250" y="-202"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Leuchte Matrix</field><statement name="STACK"><block type="variables_set" id="(L(So~,eCHHb_b/3OX9A"><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="!Kfm|d)H,cKeirrOZ+M5"><field name="VAR" id="n/_%;f5mNS1Ev%_YDewY">Dezimalcode</field></block></value><next><block type="flow_for" id="8?gOhI~8@8u4l^87u-Yr"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field><value name="FROM"><block type="math_number" id="(lCd}5y!ju,P8^BmhS];"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="@BS3]9]:}F|AC@=W]XW("><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="gaY?_yHrFkqYJ~lm[F@^"><field name="NUM">1</field></block></value><statement name="DO"><block type="variables_set" id="/zOT=$D`MV0}qc`z#j$^"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field><value name="VALUE"><block type="math_single_basic" id="TP9!}zlsxKQsbZ!oJfb|"><field name="OP">ABS</field><value name="NUM"><block type="math_div" id="p%{):;Y_9HK7#H|u.tPf"><value name="VAL1"><block type="code_pin" id="{E^Qk`#Tn,9B}:Q[yYhm"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="VAL2"><block type="math_number" id="0NE.v8P$h11vxZ!:OlN7"><field name="NUM">2</field></block></value></block></value></block></value><next><block type="logic_if" id="t2rZ?)EmqvWv.,w1~/e|"><value name="IF0"><block type="logic_compare" id="~)%.^y+KcD3LZC,rL[sO"><field name="OP">EQ</field><value name="A"><block type="variables_get" id=".=d+C=|eRc0R/$Oh|)o`"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="math_number" id="hk?`,Q#+kGHuwwG[,JwL"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="set_pixel_color" id="$#4sOy_I,5(dy=m(cOkm"><field name="MODE">MODE2</field><value name="FROM"><block type="variables_get" id="Uhhtqh~65_iF]Lk~*.a4"><field name="VAR" id="#bI4ov(rS`RxMd$x~mRD">BitNummer</field></block></value><value name="TO"><block type="math_number" id="sT4oR}=Ce3%o#W@wp-+S"><field name="NUM">1</field></block></value><value name="H"><block type="variables_get" id="nyVW[L}EH:~SZZ-_DYt9"><field name="VAR" id="w*31~?|+c#PT^JI#`;G1">Farbe°</field></block></value><value name="S"><block type="variables_get" id="TGJh[{uS|xh;sEm[,}X|"><field name="VAR" id=".+_,gCEH:Q9W:j!A62*0">Sättigung %</field></block></value><value name="B"><block type="math_arithmetic" id="!C_I~h|0MZ[+Ucm[nc1y"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="T9vL:6K=*LM^L~I3Uypk"><field name="VAR" id="l9Ei[B]UF0YL`FcrA^#|">Bit</field></block></value><value name="B"><block type="variables_get" id="C5Lm0ef,_eshom*;2qot"><field name="VAR" id="Kd8KnJ-r3g|d~PHtEiY6">Helligkeit %</field></block></value></block></value></block></statement><next><block type="variables_set" id="rGU1,%!=xQb.)$8CiLW["><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="math_arithmetic" id="uqLLj.dio)oPT}s6!,DE"><field name="OP">DIVIDE</field><value name="A"><block type="code_pin" id="{~?eq1#)+JA~IgcB(GP,"><field name="CODE_PIN">(unsigned int)Dividend</field></block></value><value name="B"><block type="math_number" id="C=5L@PiuLJNsS1}*H#X$"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></statement><next><block type="fast_led" id="C!],#6%q_KagyLso%TZg"><next><block type="fast_led_clear" id="gCE0[S7l.=s;~RHk:oqI"><next><block type="code_input" id="`)?xI_O.mMs}vJF/s)tR"><field name="CODE_INPUT">// Lerne hier, wie eine Dezimalzahl in eine Binärzahl umgewandelt wird&amp;#10;// https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=10</field></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="H1zy}oQyN]:W1}F@nqPL" x="709" y="-217"><field name="COMMENT">Trage hier die maximale freie Distanz in cm auf deiner Teststrecke ein</field></block><block type="procedures_defnoreturn" id="6$rp,+Y.vfTX,NaHq+.W" collapsed="true" x="-249" y="-155"><mutation><arg name="Dezimalcode" varid="n/_%;f5mNS1Ev%_YDewY"></arg><arg name="Farbe°" varid="w*31~?|+c#PT^JI#`;G1"></arg><arg name="Sättigung %" varid=".+_,gCEH:Q9W:j!A62*0"></arg><arg name="Helligkeit %" varid="Kd8KnJ-r3g|d~PHtEiY6"></arg></mutation><field name="NAME">Speichere Matrix in Zwischenspeicher</field><statement name="STACK"><block type="variables_set" id="?y9oNjpri~$yFa.J=6V."><field name="VAR" id="A3PF)7zzfI3ZS3bZ#rFM">Dividend</field><value name="VALUE"><block type="variables_get" id="x6:e40=EZIwLaz4j{bd#&qu