Du bist hier: Sensor > Ultraschallsensor

Arduino Ultraschallsensor programmieren

Lerne mit dieser Anleitung, wie du den HC-SR04 Ultraschallsensor ohne zusätzliche Library in wenigen Schritten mit einem Arduino programmieren kannst. Messe damit präzise Distanzen zu beliebigen Objekten und verstehe, wie ein Parksensor funktioniert oder wie sich selbstfahrende Autos im Verkehr orientieren.

Diese Anleitung basiert auf dem vereinfachten Controller von PGLU, kann aber mit jedem Arduino UNO oder NANO umgesetzt werden.

Hier geht's zur Übersetzung der Pin-Belegung ↗

1. Vorbereiten

Der Arduino Ultraschallsensor sendet und empfängt ein akustisches Signal und berechnet anhand der verstrichenen Zeit dazwischen, die Distanz zu reflektierenden Objekten.

Der Ultraschallsensor wird so angeschlossen:

  • VCC  →   +5V
  • GND →   -5V
  • Trig   →    L3 -  (Minuspol)
  • Echo →    S3▲(Eingang)

 

Anschluss an Arduino UNO/NANO:

  • VCC  →   +5V
  • GND →   GND
  • Trig   →   D3
  • Echo →   A2

2. Ultraschallsensor Verwenden

Alle Programmierungen werden mit dem grafischen PGLU-Editor ↗ gemacht. Den originalen Arduino Code findest du dann in der Code-Ansicht des Editors

2.1. Simple Verwendung dank einer "Funktion"

Mit dem Ultraschallsensor können Distanzen zwischen 1 cm und ca. 400 cm gemessen werden und dies mit einer erstaunlichen Genauigkeit. Gleich wie beim Servo, wird die Programmierung mit einer Funktion bewerkstelligt. Das ist sehr praktisch, denn die Funktion kann so an jeder beliebigen Stelle im Code eine Distanzmessung vornehmen und das Ergebnis in cm ausgeben.

2.2. Das Sketch

Hinweis: du kannst auch mit dem Ultraschallsensor arbeiten, wenn du dieses Kapitel nicht 100%ig nachvollziehst. Kopiere einfach den Code im grauen Kasten in den grafischen Editor ↗ und experimentiere mit dem Sensor. Den originalen Arduino Code findest du dann in der Code-Ansicht des Editors.


Welche Abläufe braucht es, um mit dem Ultraschallsensor HC-SR04 eine Distanz zu messen?

  • Der Sensor besitzt einen Schall-Sender und einen Empfänger
  • Der Sender wird in den Bereitschaftsmodus versetzt und dazu für die Dauer von 5μs ausgeschaltet
  • Der Sender sendet ein Burst (Schall)-Signal von 10 μs Dauer
  • Der Empfänger erwartet das Echo dieses Signals und misst die verstrichene Zeit zwischen Senden und Empfangen
  • Das Ergebnis dieser Messung wird als Stromimpuls von einer bestimmten Länge ausgegeben und in cm umgerechnet

Sketch 1: Sketch für Arduino Ultraschallsensor (Klick für Zoom)

Kopiere diesen XML-Code mit Klick/Berührung und füge ihn in den PGLU-Editor ↗ ein:

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="_7ye.we37|x%yj+NX6/w">Distanz in cm</variable><variable id="UrX!`o6_?c0KL{pT_~F+">Verstrichene Zeit</variable></variables><block type="basic_comment" id="9ZF*g[_C]{MWii;muwUJ" x="1043" y="-292"><field name="COMMENT">Setze diesen Block dort ein, wo du eine Distanz messen möchtest</field></block><block type="procedures_callreturn" id="8#z0@:2HWPo~A4cUrMCy" x="1037" y="-238"><mutation name="gemessene Distanz in cm"></mutation></block><block type="basic_comment" id="Q1Y6q|FJ8tEi~7/zT:fj" x="593" y="-141"><field name="COMMENT">Funktion für den Ultraschallsensor</field></block><block type="basic_main_loop" id="oh{4)]E/c6ZnlvMJU:hx" deletable="false" x="1042" y="-146"><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_defreturn" id="TBvQ8Sr=*[TcvQX9^5_J" collapsed="true" x="595" y="-85"><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="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="code_pin" id="Qc3n[]3qr@Uy9.DJ`)N_"><field name="CODE_PIN">(Verstrichene_Zeit*0.0343)/2</field></block></value></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></xml>

2.3. Präzise Messungen mit dem Arduino Serial Monitor

Manchmal möchtest du ganz genau wissen, welche Werte dein Ultraschallsensor misst, um ihn zu kalibrieren.

Mit dem Serial Monitor in der Arduino IDE kannst du beliebige Werte von Variablen vom Mikrocontroller an deinen PC zurücksenden. Verbinde deinen Mikrocontroller direkt via USB mit deinem Rechner und lass dir die Messwerte am Monitor live anzeigen.

Kopiere diesen XML-Code mit Klick/Berührung und füge ihn in den PGLU-Editor ↗ ein.

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="sd_,Sic*.g~CJU}[gMR!">Abstand</variable><variable id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</variable><variable id="1JJcbjQvN7M}DrfgbJx]">Verstrichene Zeit</variable></variables><block type="expert_setup" id=".MuJ/l2,D);x:f0p10NE" x="329" y="-284"><statement name="CODE"><block type="code_input" id="S|;h%8(f+|[!EWKi*~rP"><field name="CODE_INPUT">Serial.begin(9600);</field></block></statement></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" collapsed="true" x="-192" y="-174"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="}o?D=[fc-W[i9nkG`;H`"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="~pW[EU{-kZVw7qP{C}G?"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="giFU!(K8h5J,l-DFyb_X"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="1JJcbjQvN7M}DrfgbJx]">Verstrichene Zeit</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="1JJcbjQvN7M}DrfgbJx]">Verstrichene Zeit</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="326" y="-182"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="-w/=+eHWmJw{6f`bdIW9"><field name="VAR" id="sd_,Sic*.g~CJU}[gMR!">Abstand</field><value name="VALUE"><block type="procedures_callreturn" id="dQ%;i:TIiC.P]k`cE?QB"><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="code_input" id="_l.FP,{G103Vav8dgXFm"><field name="CODE_INPUT">Serial.print("Abstand = ");</field><next><block type="code_input" id=";Qb,,Fd$Atrav}WA@!V*"><field name="CODE_INPUT">Serial.print(Abstand, 0);</field><next><block type="code_input" id="KsF_H;s(7_X!Z9!UB42O"><field name="CODE_INPUT">Serial.println(" cm");</field></block></next></block></next></block></next></block></statement></block></xml>

3. Challenge

3.1. Selbstfahrendes Auto und Automatisierte Mobilität

Automatisiertes Fahren im Strassenverkehr beflügelt eine ganze Industrie zu intensiver Forschung und Entwicklung. Treibende Kräfte dahinter sind eine Verbesserung der Verkehrssicherheit, effizientere Nutzung der Energie sowie unser Wunsch das Auto noch bequemer zu machen :-)

Der Ultraschallsensor spielt, zusammen mit Videokameras und Messsystemen die auf Laser basieren (Lidar), zu den wichtigsten Technologien für diese Entwicklung.

Kannst du ein einfaches selbstfahrendes Auto bauen, mit nur einem einzigen Ultraschallsensor? Tipp: Wenn dein Auto von Zeit zu Zeit stillsteht, kann es seine Umgebung erkunden, indem es kurz nach links und nach rechts abdreht, um den Raum in beide Richtungen zu vermessen. Eine andere Variante wäre es, den Sensor auf einem Servo zu platzieren.

Die nachfolgenden Videos zeigen 4 Strategien, wie mit dem Ultraschallsensor ein Arduino Roboter mit Hinderniserkennung gesteuert werden kann. Studiere auch die dazugehörigen Flussdiagramme um zu verstehen, wie du dein selbstfahrendes Auto in wenigen Schritten intelligenter machen kannst.


Die Komponenten sind so an den PGLU-Mikrocontroller MOTOR oder KOMFORT angeschlossen:

Diese Teile sind nicht unbedingt notwendig:


Hinweis 1: Du kannst dieses Projekt auch mit einem klassischen Arduino Board umsetzen.


Hinweis 2: Alle vorgestellten Projekte basieren auf unserem Arduino Robotik Starter Set. Sie können aber auch mit jedem Arduino UNO oder NANO umgesetzt werden.

Selbstfahrendes Auto Level 1: Direkt abdrehen

Flussdiagramm Ultraschallsensor Level 1

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable></variables><block type="basic_comment" id="9E[jj_GuxO~OLIRI9a1:" x="956" y="-446"><field name="COMMENT">Unterprogramm für Distanzmessung</field></block><block type="basic_comment" id="D`$F[OHu;2}OH*Xz_CK0" x="1633" y="-446"><field name="COMMENT">Level 1</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="958" y="-401"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="flow_delay" id="2P#E]ffIVhNWgvQPfDmF"><value name="DELAY"><block type="math_number" id="[Ku3Dk#!3Kr5OHNnYG.x"><field name="NUM">50</field></block></value><next><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="tMp7VuUgu5hde7R)LN]N"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="pCuRitq$4#P86m[pakLO"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="u@,:~BrMuA/RDowEp1$O"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_comment" id="~Mz/g32NYe`dzmYs?0r$" x="1140" y="-369"><field name="COMMENT">Pause zur Verlangsamung des Prozesses</field></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1633" y="-391"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="`]%~6J|y^FFZK%LCg4TE"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id=",GX;fZ+Dbvi1Gimk)G`f"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="ch-YjFT3%Z]:ziWS:te*"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="F=dpF%@p%H^VK:3~dRP1"><field name="NUM">30</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="P%-Q%D]Znlb8.*T/xAFp"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="ncH2D-,~9;vz.7p@k0^3"><mutation name="Rechts 500"></mutation></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="PobiYeV912ZjiMRtyt1p"><mutation name="Vorwärts"></mutation></block></statement></block></statement></block><block type="basic_comment" id="P+?$?Cpzk4wQFPTv`}Ym" x="2056" y="-356"><field name="COMMENT">Distanzmessung in cm ruft Unterprogramm auf</field></block><block type="basic_comment" id="COR)TXY.N@apyNw04W(h" x="956" y="252"><field name="COMMENT">Unterprogramme für Fahrfunktionen</field></block><block type="procedures_defnoreturn" id="i+:QiLtThikTov+D[uYn" x="1304" y="254"><field name="NAME">Rückwärts 300</field><statement name="STACK"><block type="motor_write_percentage" id="Pe#*)tjsb[UBQSwC[y`["><value name="MOTOR"><block type="motor_pin" id="6Wi`!AOgJb0^ZW^^gZsv"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="4F|;]FZ)mE49)_4L9p3k"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="/H4+vTxHE(hTfa,c-y4,"><value name="MOTOR"><block type="motor_pin" id="bcFoBLtduSu1wd;1n176"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="O^g@R#87-u3YKHfdAY$R"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="lzw4-?/9`DzC?6(LHzV?"><value name="DELAY"><block type="math_number" id=")1P}v|xZD|]hS2!!7%rb"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="7z!G7auG0[-LA.W4jGNj" x="956" y="294"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="ya2)ubXK^VyD?kL:)GZT"><value name="MOTOR"><block type="motor_pin" id="7X)`44QIPi=XJy!2Z@L6"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id=".oB1Bj+Xd.a-(b4(ak25"><field name="NUM">80</field></block></value><next><block type="motor_write_percentage" id="KNdwsCd!0POev(+/O#b3"><value name="MOTOR"><block type="motor_pin" id="V`/70[X-~C1nPxoW|xF{"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_*xV4z@3)k~!%8zU]Zhl"><field name="NUM">80</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="cDkR;PbqB0j?E?-}7gg3" x="956" y="447"><field name="NAME">Links 500</field><statement name="STACK"><block type="motor_write_percentage" id="gX_D**5c`Eeznlf,WJs("><value name="MOTOR"><block type="motor_pin" id="inPC0jX@;kOK.]FRBag|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="2JM-9_Rnz%KN^QLS5Y{a"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5AB64~wmJ`VM=z`~YNFq"><value name="MOTOR"><block type="motor_pin" id="J=j$Ti+M/J2,EQ}~`J~p"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="/{iXIM0i@EI0|{@-zhMc"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="J2E}PuGJtAH/n`w[z=2r"><value name="DELAY"><block type="math_number" id="RihWbT-9[;J7oyi9#SW4"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="?t;q;Z)X=g0|Y*PeuO2h" x="1304" y="445"><field name="NAME">Rechts 500</field><statement name="STACK"><block type="motor_write_percentage" id=":L.@)DK:_2jO1HIS|ZFF"><value name="MOTOR"><block type="motor_pin" id="eJ;=z[9NBucz}~;bUp?I"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="`ZUY_K2CWSrIdDERtBTB"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="TW2:]-WqN!wFPjVxN5LL"><value name="MOTOR"><block type="motor_pin" id="tfaiT?@sw~~8)1IH=kX4"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="#?w3r84~S/-XuRJ/#~s2"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="8Ez(eS5Y?Uh~ib@t{%2X"><value name="DELAY"><block type="math_number" id="ps74y8I/+2o..t0wRV0%"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block></xml>

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="_yTEphJo*.O4d9ojg$ME">Messwert</variable><variable id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable></variables><block type="basic_comment" id="rR{K=f)$Xs-5]5dv#UBg" x="1636" y="-534"><field name="COMMENT">Level 1</field></block><block type="basic_comment" id="9E[jj_GuxO~OLIRI9a1:" x="956" y="-446"><field name="COMMENT">Unterprogramm für Distanzmessung</field></block><block type="set_neo_pixel" id=",;s(}~VN:sXUp~*^dVM`" x="1633" y="-478"><value name="NUM_LEDS"><block type="math_number" id="})]BRttj2$Y@,]`SCUjZ"><field name="NUM">5</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="jbs.-hK;bAD[;IBc8@W("><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="Y3XFy[^f;w-Vt_.u{^21"><field name="LED">LED1</field></block></value></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="958" y="-401"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="flow_delay" id="2P#E]ffIVhNWgvQPfDmF"><value name="DELAY"><block type="math_number" id="[Ku3Dk#!3Kr5OHNnYG.x"><field name="NUM">50</field></block></value><next><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="tMp7VuUgu5hde7R)LN]N"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="pCuRitq$4#P86m[pakLO"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="u@,:~BrMuA/RDowEp1$O"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="X=GoV=z_@8K7;u$*{EVt">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_comment" id="~Mz/g32NYe`dzmYs?0r$" x="1140" y="-369"><field name="COMMENT">Pause zur Verlangsamung des Prozesses</field></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1633" y="-391"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="i[zQd]8~MOfKRmaVwg$~"><field name="VAR" id="_yTEphJo*.O4d9ojg$ME">Messwert</field><value name="VALUE"><block type="procedures_callreturn" id="h`){o*2~~7FB?p-%dnKA"><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="logic_if" id="`]%~6J|y^FFZK%LCg4TE"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="u)4sVI2*6jck,Er57IPG"><field name="OP">OR</field><value name="A"><block type="sensor_test_state" id="2Yv@Z4!XR4Xb=$O9-L.R"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="^[iZ,`%Bj(Z`#1vd2fxL"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="O0c%pmic51H;1/g@(WP7"><field name="STATE">LOW</field></block></value></block></value><value name="B"><block type="logic_operation" id="E_HOBpyf#Y+U-Q=.,Wg*"><field name="OP">OR</field><value name="A"><block type="sensor_test_state" id="@(3NDgCJt%tBSrJ}xRb*"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="b9M3i/tozLN=.uS.[lYp"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="Xlz6Cm/zQDat}8/.pGX!"><field name="STATE">LOW</field></block></value></block></value><value name="B"><block type="logic_compare" id=",GX;fZ+Dbvi1Gimk)G`f"><field name="OP">LT</field><value name="A"><block type="variables_get" id="KCh=gWWMSs~hdBO7@%|9"><field name="VAR" id="_yTEphJo*.O4d9ojg$ME">Messwert</field></block></value><value name="B"><block type="math_number" id="F=dpF%@p%H^VK:3~dRP1"><field name="NUM">30</field></block></value></block></value></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="P%-Q%D]Znlb8.*T/xAFp"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="ncH2D-,~9;vz.7p@k0^3"><mutation name="Rechts 500"></mutation></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="PobiYeV912ZjiMRtyt1p"><mutation name="Vorwärts"></mutation></block></statement><next><block type="set_pixel_color" id="CGPHp*e`aK%e.ED3NF,F" inline="false"><field name="MODE">MODE1</field><value name="FROM"><block type="math_map" id="1o3A[u-TA,|q!}t3`j.?"><value name="VALUE"><block type="math_constrain" id=";Ke]p$0:.g,E*Om{7K6^"><value name="VALUE"><block type="variables_get" id="t@7E,tf_/n|*rj:cGR/3"><field name="VAR" id="_yTEphJo*.O4d9ojg$ME">Messwert</field></block></value><value name="MIN"><block type="math_number" id="yNzu0Lfy7e$FHKgE]V1E"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="]TksRNUbohQ,KigKy*g*"><field name="NUM">250</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="XHn7xt?6D)EkEBZ:}VBB"><field name="NUM">30</field></block></value><value name="FROMHIGH"><block type="math_number" id="2f12x)+65q1JAWho-)/*"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="oc~=r?@xv%$@?_m1tC*P"><field name="NUM">1</field></block></value><value name="TOHIGH"><block type="math_number" id="Q]bM0a^$:?=2AYgDP]ew"><field name="NUM">5</field></block></value></block></value><value name="TO"><block type="math_number" id=".NVT4LlmE#sG7!WE6O7]"><field name="NUM">1</field></block></value><value name="H"><block type="math_arithmetic" id="N{x$hii6^HKhn9cQ#M:w"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id=".8m_aXh!vMOY/P99:)qY"><value name="VALUE"><block type="variables_get" id="nhPcqRidXHTeQ9_F?Dh$"><field name="VAR" id="_yTEphJo*.O4d9ojg$ME">Messwert</field></block></value><value name="MIN"><block type="math_number" id="iynDgtXsbQZgQA)!zRpK"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="E7`NopWz[K!EIknIIw2W"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="D4#6!Ax2~d8?pPwXZbVK"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="Mfajz$r^+{9_=C=rJ@:{"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="S8d[P]O%_T+kBydfnN3n"><field name="NUM">100</field></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="P+?$?Cpzk4wQFPTv`}Ym" x="2131" y="-365"><field name="COMMENT">Distanzmessung in cm ruft Unterprogramm auf</field></block><block type="basic_comment" id="COR)TXY.N@apyNw04W(h" x="956" y="252"><field name="COMMENT">Unterprogramme für Fahrfunktionen</field></block><block type="procedures_defnoreturn" id="i+:QiLtThikTov+D[uYn" x="1304" y="254"><field name="NAME">Rückwärts 300</field><statement name="STACK"><block type="motor_write_percentage" id="Pe#*)tjsb[UBQSwC[y`["><value name="MOTOR"><block type="motor_pin" id="6Wi`!AOgJb0^ZW^^gZsv"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="4F|;]FZ)mE49)_4L9p3k"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="/H4+vTxHE(hTfa,c-y4,"><value name="MOTOR"><block type="motor_pin" id="bcFoBLtduSu1wd;1n176"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="O^g@R#87-u3YKHfdAY$R"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="lzw4-?/9`DzC?6(LHzV?"><value name="DELAY"><block type="math_number" id=")1P}v|xZD|]hS2!!7%rb"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="7z!G7auG0[-LA.W4jGNj" x="956" y="294"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="ya2)ubXK^VyD?kL:)GZT"><value name="MOTOR"><block type="motor_pin" id="7X)`44QIPi=XJy!2Z@L6"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id=".oB1Bj+Xd.a-(b4(ak25"><field name="NUM">80</field></block></value><next><block type="motor_write_percentage" id="KNdwsCd!0POev(+/O#b3"><value name="MOTOR"><block type="motor_pin" id="V`/70[X-~C1nPxoW|xF{"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_*xV4z@3)k~!%8zU]Zhl"><field name="NUM">80</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="cDkR;PbqB0j?E?-}7gg3" x="956" y="447"><field name="NAME">Links 500</field><statement name="STACK"><block type="motor_write_percentage" id="gX_D**5c`Eeznlf,WJs("><value name="MOTOR"><block type="motor_pin" id="inPC0jX@;kOK.]FRBag|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="2JM-9_Rnz%KN^QLS5Y{a"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5AB64~wmJ`VM=z`~YNFq"><value name="MOTOR"><block type="motor_pin" id="J=j$Ti+M/J2,EQ}~`J~p"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="/{iXIM0i@EI0|{@-zhMc"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="J2E}PuGJtAH/n`w[z=2r"><value name="DELAY"><block type="math_number" id="RihWbT-9[;J7oyi9#SW4"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="?t;q;Z)X=g0|Y*PeuO2h" x="1304" y="445"><field name="NAME">Rechts 500</field><statement name="STACK"><block type="motor_write_percentage" id=":L.@)DK:_2jO1HIS|ZFF"><value name="MOTOR"><block type="motor_pin" id="eJ;=z[9NBucz}~;bUp?I"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="`ZUY_K2CWSrIdDERtBTB"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="TW2:]-WqN!wFPjVxN5LL"><value name="MOTOR"><block type="motor_pin" id="tfaiT?@sw~~8)1IH=kX4"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="#?w3r84~S/-XuRJ/#~s2"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="8Ez(eS5Y?Uh~ib@t{%2X"><value name="DELAY"><block type="math_number" id="ps74y8I/+2o..t0wRV0%"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block></xml>

Mit Klick/Berührung XML-Code kopieren und in PGLU-Editor ↗ einfügen
Links Grundversion, rechts Version wie in Video

Selbstfahrendes Auto Level 2: Stoppen und Umgebung erkunden I

Flussdiagramm Ultraschallsensor Level 2

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert links</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable><variable id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</variable></variables><block type="basic_comment" id="iG:ItmMh0w*k5Gy-W==(" x="934" y="-143"><field name="COMMENT">Unterprogramm Distanzmessung</field></block><block type="basic_comment" id="X!zxlgl6$|Emtia2~)jn" x="1925" y="-155"><field name="COMMENT">Level 2</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="935" y="-99"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="EGa7_ZH!jjO+@HK:l3*!"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="6K}cG*Io9D,BZS`;woSz"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="S/w7Zb-3Q;bfo8GDOF`="><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1925" y="-92"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="Um9rvVnq_WDa)g}@dwaJ"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">15</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="t/W;t~!ct4V@dQPGmHq|"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="w:(Mj||DQg4)dA,3)xYT"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="(j-L73Y:ez,cFM[Heu22"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="?{afB$LlQaa$]TYW%{vE"><mutation name="Drehen links 200"></mutation><next><block type="variables_set" id="6x%h4G?`%D[TqA;#(z/)"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field><value name="VALUE"><block type="procedures_callreturn" id="ldV?ky3CEQ.]PD;]T_t["><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="procedures_callnoreturn" id="%j(h)iG46;_yDKJU%RQv"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="CCXB4PxuBt%G#q}^PGTF"><mutation name="Drehen rechts 200"></mutation><next><block type="procedures_callnoreturn" id="-5HmXvP(pFXb=hAQ*Y[^"><mutation name="Drehen rechts 201"></mutation><next><block type="variables_set" id="ZIa~M5hU3*`Jo.Rz;:A4"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field><value name="VALUE"><block type="procedures_callreturn" id="E#}hS1SOHf[c.T9,JM8."><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="procedures_callnoreturn" id="$cKgRRMSQWN/,%$9D-?:"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id=",T%^CxFJQuf.Uo^x_Wfv"><mutation name="Drehen links 200"></mutation><next><block type="logic_if" id="i4~4LGe`X.!8P*%G^OUL"><value name="IF0"><block type="logic_compare" id="2,yMd5g2X5IkP!%#Zyu["><field name="OP">LT</field><value name="A"><block type="variables_get" id=":xyCy|LTmsd/gygZq2E%"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="Ht9Bz-u0E*+`/{II8eND"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="COaWY|#/~f-3V/2Xqpd0"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="rooEO0,gc5:EJ;imk?*Q"><mutation name="Drehen links 200"></mutation></block></next></block></statement><next><block type="logic_if" id="11IM+e!;{+2YFS?p[(qP"><value name="IF0"><block type="logic_compare" id="uW.W)@wZe7qq00H~V1-W"><field name="OP">GT</field><value name="A"><block type="variables_get" id="[!zkGqK1$|n[Osr..Ur{"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="AA.hFtc`}Yhewg!|@th|"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="IgADLTaa^WDw.,TQST2L"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id=".y-Wgs1|m2$EjD9RHvOP"><mutation name="Drehen rechts 200"></mutation></block></next></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></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement></block></statement></block><block type="basic_comment" id="AO_S/ue57@wO^.^yhX@," x="2340" y="-55"><field name="COMMENT">Reagiere, wenn die Distanz unter 15cm ist</field></block><block type="basic_comment" id="D#uR/_Uwq=svgq*-c?i}" x="2403" y="99"><field name="COMMENT">Speichere den Messwert als "Messwert links"</field></block><block type="basic_comment" id="GN63YGnMjF2yd6/..mgl" x="2411" y="219"><field name="COMMENT">Speichere den Messwert als "Messwert rechts"</field></block><block type="basic_comment" id="X#[`4I%rOKDU8](nKYu!" x="2463" y="315"><field name="COMMENT">Vergleiche die beiden Messwerte und ziehe die Schlüsse daraus: In welche Richtung soll wieder losgefahren werden?</field></block><block type="basic_comment" id="0]nlT5l)-$O*tfSy~)p]" x="936" y="506"><field name="COMMENT">Unterprogramme Fahrfunktionen. Die Länge der Pausen beeinflussen das Verhalten erheblich. Experimentiere damit!</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="936" y="551"><field name="NAME">Rückwärts 300</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="S7)$6x0nxoSA:(JO5e;`" x="1276" y="554"><field name="NAME">Stopp 500</field><statement name="STACK"><block type="motor_write_percentage" id="2V.qqTGpDo8e;Y?+.ox3"><value name="MOTOR"><block type="motor_pin" id="QD9Ad_VT4*D%URD*:~]c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M}8aqPqOp]-}oVRu.98s"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="^8cwA^DoqGmp2LtgR(-7"><value name="MOTOR"><block type="motor_pin" id="2zDs((zJIq4#0io,#j_:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M@`X=|lF/C=5{JFYv(!h"><field name="NUM">0</field></block></value><next><block type="flow_delay" id="%PJ*!53?9^wDEg=jswm4"><value name="DELAY"><block type="math_number" id="_q,^PCXPhAGAi|siNkgU"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="S_T.C*8wnUhhtt_`CRw8" x="2088" y="556"><field name="COMMENT">Fahre vorwärts, falls keine Distanzmessung unter 15cm liegt</field></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="937" y="734"><field name="NAME">Drehen rechts 200</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1277" y="769"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">100</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="fOz.,A$Wav%x2OEL/krP" x="938" y="920"><field name="NAME">Drehen rechts 201</field><statement name="STACK"><block type="motor_write_percentage" id="T:|Kl6$v/{UnaN)RS6Zh"><value name="MOTOR"><block type="motor_pin" id="zS,|X~xx?)plMqR5hurA"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="SpY2w6iM`6@{E5w@eGJN"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="-YAaU0RkVxZjcS_VC6W!"><value name="MOTOR"><block type="motor_pin" id=",`eMEyT#0d4@bNceW^:$"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="k-Lx_D(Dn+eia7{T,y{N"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="q@v6W#KEH,|g!}*VZCZb"><value name="DELAY"><block type="math_number" id="HK9;0)K1%?4Gqux{hO;3"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="1277" y="916"><field name="NAME">Drehen links 200</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block></xml>

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert links</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable><variable id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</variable></variables><block type="basic_comment" id="JtrJbNpHDxQOxu/%Nyh:" x="1925" y="-217"><field name="COMMENT">Level 2</field></block><block type="basic_comment" id="m/ZN.e~i$I!7?+*Cv8wR" x="939" y="-147"><field name="COMMENT">Unterprogramm Distanzmessung</field></block><block type="set_neo_pixel" id="yMuJn+`4#h-0::Js1CeY" x="1927" y="-159"><value name="NUM_LEDS"><block type="math_number" id="(;Yz=u-MV-a:e%ZK!n/x"><field name="NUM">5</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="(MH9}CAfUh(7xxyfY`~g"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="hPWXT|^:B-{0Vy.!u_IV"><field name="LED">LED1</field></block></value></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="940" y="-97"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="qJY7l9]-+c?DZeM~VydO"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="4OymquCXjA8aq[exWa^5"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="TEcuD%jt%xxp29a6T%Q7"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1925" y="-92"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="set_pixel_color" id="k0!9K6G2@pLCVzSnhOX]"><field name="MODE">MODE1</field><value name="FROM"><block type="math_map" id="^fG:{|fe}u)^5KxMk8WV"><value name="VALUE"><block type="math_constrain" id="HL$i#9eE)em/l~f7k=5r"><value name="VALUE"><block type="math_arithmetic" id="0pIYQMm]jm.$pRXDN?{N"><field name="OP">MINUS</field><value name="A"><block type="variables_get" id="31~Y5*ucf.,^A.=yRDqZ"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="UCl{KuhSxp_WchAN}i*W"><field name="NUM">30</field></block></value></block></value><value name="MIN"><block type="math_number" id="aA:;?pAkP!tZ5^f*hJKl"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="ZL%%Ps3LL$I_$R%Z7:a:"><field name="NUM">150</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="Y%r=6O+WV6kPX6p#s^{="><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="$Cp9#ZBs5y-G%1(zgnf7"><field name="NUM">150</field></block></value><value name="TOLOW"><block type="math_number" id="dXu/CLx+$aK5Z#h1ZUKN"><field name="NUM">1</field></block></value><value name="TOHIGH"><block type="math_number" id="Us#ea:MRi4~=^M09?[Me"><field name="NUM">5</field></block></value></block></value><value name="TO"><block type="math_number" id="zXp?Eo:C(P=)kuVJOC0c"><field name="NUM">1</field></block></value><value name="H"><block type="math_arithmetic" id="qiT94G^?^Saa$nO;yk0A"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id=".soU}$3.geuUE!*7^=|I"><value name="VALUE"><block type="variables_get" id="`*m]L#r@XTx7o#b=(W;M"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="MIN"><block type="math_number" id="UtU}+!b;AnIeAMJ_ec-#"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="h7=k}LB+h|r7Li5]c=C@"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="cxKo-jR^LnTxiD((ItMK"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="D=wGqZ|@5$6lC;e{!G^."><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="JRj|-.`5^*`ky(Y3=7;f"><field name="NUM">100</field></block></value><next><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="b78A1pfv9Qi^QKo.G=a!"><field name="OP">OR</field><value name="A"><block type="logic_operation" id="aD#.}m5Y1Y{EHLZE6lZ:"><field name="OP">OR</field><value name="A"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="procedures_callreturn" id="Um9rvVnq_WDa)g}@dwaJ"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">15</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="+VjIMSm7HKULsFn2.5P?"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="gw*O:2.0_a_]UI2S5JBq"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="zlb%ws@eXhw-BbpB5PWw"><field name="STATE">LOW</field></block></value></block></value></block></value><value name="B"><block type="sensor_test_state" id="xnN#e?=P2-yVMJDFU5k4"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="O_+s1.:q]JH3_O)o8NU!"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="!eYEY%jyPH!T%dK[E{K."><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="t/W;t~!ct4V@dQPGmHq|"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="w:(Mj||DQg4)dA,3)xYT"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="(j-L73Y:ez,cFM[Heu22"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="?{afB$LlQaa$]TYW%{vE"><mutation name="Drehen links 200"></mutation><next><block type="variables_set" id="6x%h4G?`%D[TqA;#(z/)"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field><value name="VALUE"><block type="procedures_callreturn" id="ldV?ky3CEQ.]PD;]T_t["><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="set_pixel_color" id="~=%bcgjNJs-#4vH)7f/7"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="88{gKfFCVobRviBVjiF?"><field name="NUM">4</field></block></value><value name="TO"><block type="math_number" id="Znb3.78UI`ad#hwN{5JL"><field name="NUM">2</field></block></value><value name="H"><block type="math_arithmetic" id="vP55,-zr=E,9*}6k9:T."><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="{UKxjL]js$}u+z6)d9$D"><value name="VALUE"><block type="math_arithmetic" id="|H.hP5?kLJWlkLMM*1gd"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="DVE--(jK10o)vh`~-%v="><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="math_number" id="mce_FVbpi4(;B0AHO/nn"><field name="NUM">3</field></block></value></block></value><value name="MIN"><block type="math_number" id="??c]Jm,,8K5A67oGW57m"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="ZBI?4%DfmY*f([(Dp6Ra"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="M]ZK{M8kTOVGK9~Za=qw"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="D+l}T`Zv~3o=6rlL61]i"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="Tghn{P?3h4VP2{VD(*fB"><field name="NUM">100</field></block></value><next><block type="fast_led" id="?v_,.+iFwYXT~x``gf!2"><next><block type="procedures_callnoreturn" id="%j(h)iG46;_yDKJU%RQv"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id="CCXB4PxuBt%G#q}^PGTF"><mutation name="Drehen rechts 200"></mutation><next><block type="procedures_callnoreturn" id="-5HmXvP(pFXb=hAQ*Y[^"><mutation name="Drehen rechts 201"></mutation><next><block type="variables_set" id="ZIa~M5hU3*`Jo.Rz;:A4"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field><value name="VALUE"><block type="procedures_callreturn" id="E#}hS1SOHf[c.T9,JM8."><mutation name="Gemessene Distanz in cm"></mutation></block></value><next><block type="set_pixel_color" id="s;x=LbYp+Qx5x*gn1ILo"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="_R{UJvcxfoa8Z2H9sjSH"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="*C#$KZ?i~+Db.-+c|U(3"><field name="NUM">2</field></block></value><value name="H"><block type="math_arithmetic" id="/H)3uRyxFMNU0(HA:a%#"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="`Q#lKfwx4O`jYBv^aIo)"><value name="VALUE"><block type="math_arithmetic" id="U,ny]n.(Cn#o;78,9n7{"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="CSbaOCa,?B!tM/jWq)gn"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="B"><block type="math_number" id="P~EY{gx3|4^Q}BBxD3T)"><field name="NUM">3</field></block></value></block></value><value name="MIN"><block type="math_number" id="Fm-c__Kn,%QHLus!X.jE"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="wZi_sG9b/9$3;=lij#C{"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="aY~z%4Dh4p~,x9Ua}{n,"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="T:Px.Xacv}bv(09u-,^T"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="0aI{pxqJLTH^D*2_ZQat"><field name="NUM">100</field></block></value><next><block type="fast_led" id="Q(hUI,;GL4e3::X_Cdp."><next><block type="procedures_callnoreturn" id="$cKgRRMSQWN/,%$9D-?:"><mutation name="Stopp 500"></mutation><next><block type="procedures_callnoreturn" id=",T%^CxFJQuf.Uo^x_Wfv"><mutation name="Drehen links 200"></mutation><next><block type="logic_if" id="i4~4LGe`X.!8P*%G^OUL"><value name="IF0"><block type="logic_compare" id="2,yMd5g2X5IkP!%#Zyu["><field name="OP">LT</field><value name="A"><block type="variables_get" id=":xyCy|LTmsd/gygZq2E%"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="Ht9Bz-u0E*+`/{II8eND"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="COaWY|#/~f-3V/2Xqpd0"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id="rooEO0,gc5:EJ;imk?*Q"><mutation name="Drehen links 200"></mutation></block></next></block></statement><next><block type="logic_if" id="11IM+e!;{+2YFS?p[(qP"><value name="IF0"><block type="logic_compare" id="uW.W)@wZe7qq00H~V1-W"><field name="OP">GT</field><value name="A"><block type="variables_get" id="[!zkGqK1$|n[Osr..Ur{"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="AA.hFtc`}Yhewg!|@th|"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="IgADLTaa^WDw.,TQST2L"><mutation name="Rückwärts 300"></mutation><next><block type="procedures_callnoreturn" id=".y-Wgs1|m2$EjD9RHvOP"><mutation name="Drehen rechts 200"></mutation></block></next></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></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement></block></next></block></statement></block><block type="basic_comment" id="JhE8HPq-SDGb)pq(+]yx" x="2483" y="-100"><field name="COMMENT">Pixelblöcke visualisieren die Distanzmessungen - sie könnten auch entfernt werden</field></block><block type="basic_comment" id="AO_S/ue57@wO^.^yhX@," x="2131" y="79"><field name="COMMENT">Reagiere, wenn die Distanz unter 15cm ist</field></block><block type="basic_comment" id="poMF|E4Okbg*1UEACy?*" x="2591" y="79"><field name="COMMENT">eigentiche Distanzmessung . Die klassischen Sensoren und die "oders" können entfernt werden</field></block><block type="basic_comment" id="D#uR/_Uwq=svgq*-c?i}" x="2216" y="161"><field name="COMMENT">Speichere den Messwert als "Messwert links"</field></block><block type="basic_comment" id="GN63YGnMjF2yd6/..mgl" x="2229" y="383"><field name="COMMENT">Speichere den Messwert als "Messwert rechts"</field></block><block type="basic_comment" id="0]nlT5l)-$O*tfSy~)p]" x="941" y="510"><field name="COMMENT">Unterprogramme Fahrfunktionen. Die Länge der Pausen beeinflussen das Verhalten erheblich. Experimentiere damit!</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="943" y="560"><field name="NAME">Rückwärts 300</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="S7)$6x0nxoSA:(JO5e;`" x="1313" y="564"><field name="NAME">Stopp 500</field><statement name="STACK"><block type="motor_write_percentage" id="2V.qqTGpDo8e;Y?+.ox3"><value name="MOTOR"><block type="motor_pin" id="QD9Ad_VT4*D%URD*:~]c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M}8aqPqOp]-}oVRu.98s"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="^8cwA^DoqGmp2LtgR(-7"><value name="MOTOR"><block type="motor_pin" id="2zDs((zJIq4#0io,#j_:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M@`X=|lF/C=5{JFYv(!h"><field name="NUM">0</field></block></value><next><block type="flow_delay" id="%PJ*!53?9^wDEg=jswm4"><value name="DELAY"><block type="math_number" id="_q,^PCXPhAGAi|siNkgU"><field name="NUM">500</field></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="X#[`4I%rOKDU8](nKYu!" x="2454" y="616"><field name="COMMENT">Vergleiche die beiden Messwerte und ziehe die Schlüsse daraus: In welche Richtung soll wieder losgefahren werden?</field></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="942" y="744"><field name="NAME">Drehen rechts 200</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1322" y="789"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">100</field></block></value></block></next></block></statement></block><block type="basic_comment" id="S_T.C*8wnUhhtt_`CRw8" x="2079" y="860"><field name="COMMENT">Fahre vorwärts, falls keine Distanzmessung unter 15cm liegt</field></block><block type="procedures_defnoreturn" id="fOz.,A$Wav%x2OEL/krP" x="942" y="934"><field name="NAME">Drehen rechts 201</field><statement name="STACK"><block type="motor_write_percentage" id="T:|Kl6$v/{UnaN)RS6Zh"><value name="MOTOR"><block type="motor_pin" id="zS,|X~xx?)plMqR5hurA"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="SpY2w6iM`6@{E5w@eGJN"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="-YAaU0RkVxZjcS_VC6W!"><value name="MOTOR"><block type="motor_pin" id=",`eMEyT#0d4@bNceW^:$"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="k-Lx_D(Dn+eia7{T,y{N"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="q@v6W#KEH,|g!}*VZCZb"><value name="DELAY"><block type="math_number" id="HK9;0)K1%?4Gqux{hO;3"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="1320" y="934"><field name="NAME">Drehen links 200</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">300</field></block></value></block></next></block></next></block></statement></block></xml>

Mit Klick/Berührung XML-Code kopieren und in PGLU-Editor ↗ einfügen
Links Grundversion, rechts Version wie in Video

Selbstfahrendes Auto Level 3: Stoppen und Umgebung erkunden II

Flussdiagramm Ultraschallsensor Level 3

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="|i(*bYM!mN`${xKeP?F`">Servo-Position</variable><variable id="5xk*8.okpYXB|;B7~8AK">Pause</variable><variable id="-;pD43ioxfK7?x~,KNH(">Servo Pin</variable><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="F-nCo+j1N;ofMnsD!qPg">Messwert</variable><variable id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert links</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable></variables><block type="basic_comment" id="*6_lbrU/[dQG7Eg|~Pn_" x="927" y="-579"><field name="COMMENT">Unterprogramm für Distanzmessung</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="928" y="-537"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="JoHQr^p@_Jnji!30$7.{"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="hsbt.2On$Zx$#`,ELji*"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="YP-7(Yy%Wt0SB!fRPUjI"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_comment" id=",8PQ2LjqmSF%v|!V[OVf" x="1624" y="-570"><field name="COMMENT">Level 3</field></block><block type="basic_comment" id="kL)W9e3P#4gM_.7mP,m1" x="1623" y="-519"><field name="COMMENT">Die Funktionalität des Roboters wird erheblich von der ersten Distanzmessung (während des Fahrens) beeinflusst. Experimentiere mit dem Wert 25cm</field></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1624" y="-475"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="*c|ExXP3,JLOK{v)I*0Y"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="o[FWnx*s,i}7,y6z(sNa"><field name="NUM">50</field></block></value><value name="ARG1"><block type="math_number" id="0^9~w0+@pETMO11ad^wk"><field name="NUM">10</field></block></value><next><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="variables_get" id="x~uYiJr+R@8(@Xh.DW2!"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">25</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="(j-L73Y:ez,cFM[Heu22"><mutation name="Stopp"></mutation><next><block type="procedures_callnoreturn" id="{}_).c[b`;vOFe/5oagX"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="wJmR:}y[)|+mY;K7peE/"><field name="NUM">5</field></block></value><value name="ARG1"><block type="math_number" id="mb@vtU]g_A|-EcOuWldZ"><field name="NUM">500</field></block></value><next><block type="variables_set" id="6x%h4G?`%D[TqA;#(z/)"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field><value name="VALUE"><block type="variables_get" id="v0PkFZqgc?inqbdb8{sR"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field></block></value><next><block type="procedures_callnoreturn" id="[Bx?=LI:I$:Cy|PFc.-g"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="B[=uN:F@tyR?22Qz(8un"><field name="NUM">95</field></block></value><value name="ARG1"><block type="math_number" id=",u3Wm:jXBy]n2}B+~!!~"><field name="NUM">500</field></block></value><next><block type="variables_set" id="ZIa~M5hU3*`Jo.Rz;:A4"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field><value name="VALUE"><block type="variables_get" id="@Sg@#oLa1Gz,pK0h=J@4"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field></block></value><next><block type="logic_if" id="i4~4LGe`X.!8P*%G^OUL"><value name="IF0"><block type="logic_compare" id="2,yMd5g2X5IkP!%#Zyu["><field name="OP">LT</field><value name="A"><block type="variables_get" id=":xyCy|LTmsd/gygZq2E%"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="Ht9Bz-u0E*+`/{II8eND"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="3heaXlme1MFxGuSXJeWX"><mutation name="Rückwärts 150"></mutation><next><block type="procedures_callnoreturn" id="rooEO0,gc5:EJ;imk?*Q"><mutation name="Drehen links 200"></mutation></block></next></block></statement><next><block type="logic_if" id="11IM+e!;{+2YFS?p[(qP"><value name="IF0"><block type="logic_compare" id="uW.W)@wZe7qq00H~V1-W"><field name="OP">LT</field><value name="A"><block type="variables_get" id="AA.hFtc`}Yhewg!|@th|"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="B"><block type="variables_get" id="[!zkGqK1$|n[Osr..Ur{"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="xmfu)}BCX-0oc[Hu@Dow"><mutation name="Rückwärts 150"></mutation><next><block type="procedures_callnoreturn" id=".y-Wgs1|m2$EjD9RHvOP"><mutation name="Drehen rechts 200"></mutation></block></next></block></statement><next><block type="procedures_callnoreturn" id="uRD0|`1hYtdg^`J#41,L"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="9pyq0#cnre*D(a|2sCxT"><field name="NUM">50</field></block></value><value name="ARG1"><block type="led_pin" id="i[{M9zBZ}qD@!~T4%Nl?"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id=",XX{ri5XLUR|Yc[oRk;W"><value name="DELAY"><block type="math_number" id="wwdKs+=ml{]8aBOgd`)P"><field name="NUM">200</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement></block></next></block></statement></block><block type="basic_comment" id="7h@`Hu{GxCwUk|IOmz^D" x="2057" y="-439"><field name="COMMENT">Eigentliche Distanzmessung aus der Fahrt heraus. Sie entscheidet, ob eine Umgebungsmessung gemacht werden soll</field></block><block type="basic_comment" id="){KdT{DZ{/SOfza1*75Q" x="2200" y="-345"><field name="COMMENT">Die Umgebungsmessung beinhaltet einen Servo-Befehl und eine Distanzmessung (siehe Unterprogramme). Hier: Umgebungsmessung rechts</field></block><block type="basic_comment" id="XFEa3Tz@etqnuo}1Z_RR" x="2201" y="-311"><field name="COMMENT">Speichere den Messwert für rechts</field></block><block type="basic_comment" id="6_{b)b@]$cMgS1H61JLN" x="2200" y="-259"><field name="COMMENT">Die Umgebungsmessung beinhaltet einen Servo-Befehl und eine Distanzmessung (siehe Unterprogramme). Hier: Umgebungsmessung links</field></block><block type="basic_comment" id="0*$*Ikcja?B2^FiPJ^7w" x="2199" y="-222"><field name="COMMENT">Speichere den Messwert für links</field></block><block type="basic_comment" id="sX/qs(glKC,?di6=bZlF" x="2200" y="-187"><field name="COMMENT">Vergleiche die beiden Messwerte und ziehe deine Schlüsse daraus für die Weiterfahrt</field></block><block type="basic_comment" id="3w{u=x.j0dby!=OjpL{u" x="928" y="68"><field name="COMMENT">Unter- Unterprogramm für Umgebungsmessung</field></block><block type="procedures_defnoreturn" id="VRt`=0k8_P/mV9Yxu%AX" x="930" y="107"><mutation><arg name="Servo-Position" varid="|i(*bYM!mN`${xKeP?F`"></arg><arg name="Pause" varid="5xk*8.okpYXB|;B7~8AK"></arg></mutation><field name="NAME">Messe Umgebung</field><statement name="STACK"><block type="procedures_callnoreturn" id="RNUQSrb7PChn(|`v?ckb"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="variables_get" id="sHs_v1uJ1`?U]YBf#(9y"><field name="VAR" id="|i(*bYM!mN`${xKeP?F`">Servo-Position</field></block></value><value name="ARG1"><block type="led_pin" id="}FOno*c:|G!/AA#b[IG_"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="gwB_Cn6;!Zi!%M_*Dn)d"><value name="DELAY"><block type="variables_get" id="wYInTtPK._YQ-#k;g|w~"><field name="VAR" id="5xk*8.okpYXB|;B7~8AK">Pause</field></block></value><next><block type="variables_set" id="|`36zz;O)/$FiB/UI#0l"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field><value name="VALUE"><block type="procedures_callreturn" id="4,YMyNt|#[8#-?/kuyQ9"><mutation name="Gemessene Distanz in cm"></mutation></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="usd/[F,baJ_g?5#x[e7g" x="1782" y="138"><field name="COMMENT">Fahre vorwärts, falls keine Distanzmessung während der Fahrt bei unter 25cm liegt</field></block><block type="basic_comment" id="ClA?^1mR@?F(d/5(i-)A" x="931" y="273"><field name="COMMENT">Unterprogramm für Servo-Position</field></block><block type="procedures_defnoreturn" id="SvD*~(wF:bQ+*pxHBzM`" x="932" y="313"><mutation><arg name="Servo-Position" varid="|i(*bYM!mN`${xKeP?F`"></arg><arg name="Servo Pin" varid="-;pD43ioxfK7?x~,KNH("></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="flow_repeat" id="696u9{gUh%DX=ESZ[8FD"><value name="REPEATS"><block type="math_number" id="VUiY;1;*E7tO_p-ae][@"><field name="NUM">8</field></block></value><statement name="DO"><block type="led_write_state" id="wmPw_VrM1K9l%sKNM/#~"><value name="LED"><block type="variables_get" id="OkF]+(f1;{!r,7wzr0{7"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="Yq(t3{xv*(zD!?PTp?5J"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="kBh?U*!Jxnzp49yveJSb"><value name="DELAY_MICRO"><block type="math_map" id="A5z9ldnV:H/2SH4Qn_me"><value name="VALUE"><block type="variables_get" id="hm3u7#}LZoW_,(`_Xd!d"><field name="VAR" id="|i(*bYM!mN`${xKeP?F`">Servo-Position</field></block></value><value name="FROMLOW"><block type="math_number" id="dS9RH{6ve5y3m.FKa$zh"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="j{0S:qp_n5Q%~NIOM{@f"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="/z+7ZI/E-?mB7pd~N_a]"><field name="NUM">600</field></block></value><value name="TOHIGH"><block type="math_number" id="bRLf238EJ61zRz*pKp;_"><field name="NUM">2400</field></block></value></block></value><next><block type="led_write_state" id="o~J#OtCp({uB0B[s}/X_"><value name="LED"><block type="variables_get" id="!~e?9/=SmSJ{]A]JDc{W"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="7i8m4HZ}b6=,J~6JJIMv"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="c9vn|7uBF-L^e1@}+~;/"><value name="DELAY"><block type="math_number" id="[`]`CAa(t0[Ok2+cA=|d"><field name="NUM">19</field></block></value></block></next></block></next></block></next></block></statement></block></statement></block><block type="basic_comment" id="_H%wd/-g3M:!s%6:~#sf" x="932" y="602"><field name="COMMENT">Unterprogramme für die Fahrfunktion - die Pausen haben erheblichen Einfluss auf das Verhalten des Roboters. Experimentiere damit!</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="933" y="643"><field name="NAME">Rückwärts 150</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">150</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1285" y="643"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">100</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="S7)$6x0nxoSA:(JO5e;`" x="1623" y="640"><field name="NAME">Stopp</field><statement name="STACK"><block type="motor_write_percentage" id="2V.qqTGpDo8e;Y?+.ox3"><value name="MOTOR"><block type="motor_pin" id="QD9Ad_VT4*D%URD*:~]c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M}8aqPqOp]-}oVRu.98s"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="^8cwA^DoqGmp2LtgR(-7"><value name="MOTOR"><block type="motor_pin" id="2zDs((zJIq4#0io,#j_:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M@`X=|lF/C=5{JFYv(!h"><field name="NUM">0</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="1285" y="778"><field name="NAME">Drehen links 200</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">100</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">250</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="933" y="820"><field name="NAME">Drehen rechts 200</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">250</field></block></value></block></next></block></next></block></statement></block></xml>

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="|i(*bYM!mN`${xKeP?F`">Servo-Position</variable><variable id="5xk*8.okpYXB|;B7~8AK">Pause</variable><variable id="-;pD43ioxfK7?x~,KNH(">Servo Pin</variable><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="F-nCo+j1N;ofMnsD!qPg">Messwert</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert links</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable></variables><block type="basic_comment" id="[;uXO3xRdiJlh!PE]l?N" x="1752" y="-642"><field name="COMMENT">Level 3</field></block><block type="basic_comment" id="*6_lbrU/[dQG7Eg|~Pn_" x="927" y="-579"><field name="COMMENT">Unterprogramm für Distanzmessung</field></block><block type="basic_comment" id="kL)W9e3P#4gM_.7mP,m1" x="1753" y="-591"><field name="COMMENT">Die Funktionalität des Roboters wird erheblich von der ersten Distanzmessung (während des Fahrens) beeinflusst. Experimentiere mit dem Wert 25cm</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="928" y="-537"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="K8)TyEecN6+jpY/}i^I9"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="px:Jp1vCK]RhgIZ?lso8"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="%0HHyeC=p@pLg@:UJm)="><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="set_neo_pixel" id="yMuJn+`4#h-0::Js1CeY" x="1750" y="-543"><value name="NUM_LEDS"><block type="math_number" id="(;Yz=u-MV-a:e%ZK!n/x"><field name="NUM">5</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="(MH9}CAfUh(7xxyfY`~g"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="87_.N60?5n{42k)D-BgV"><field name="LED">LED1</field></block></value></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1749" y="-476"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="*c|ExXP3,JLOK{v)I*0Y"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="o[FWnx*s,i}7,y6z(sNa"><field name="NUM">50</field></block></value><value name="ARG1"><block type="math_number" id="0^9~w0+@pETMO11ad^wk"><field name="NUM">10</field></block></value><next><block type="set_pixel_color" id="k0!9K6G2@pLCVzSnhOX]"><field name="MODE">MODE1</field><value name="FROM"><block type="math_map" id="^fG:{|fe}u)^5KxMk8WV"><value name="VALUE"><block type="math_constrain" id="HL$i#9eE)em/l~f7k=5r"><value name="VALUE"><block type="math_arithmetic" id="0pIYQMm]jm.$pRXDN?{N"><field name="OP">MINUS</field><value name="A"><block type="variables_get" id="31~Y5*ucf.,^A.=yRDqZ"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="UCl{KuhSxp_WchAN}i*W"><field name="NUM">35</field></block></value></block></value><value name="MIN"><block type="math_number" id="aA:;?pAkP!tZ5^f*hJKl"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="ZL%%Ps3LL$I_$R%Z7:a:"><field name="NUM">150</field></block></value></block></value><value name="FROMLOW"><block type="math_number" id="Y%r=6O+WV6kPX6p#s^{="><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="$Cp9#ZBs5y-G%1(zgnf7"><field name="NUM">150</field></block></value><value name="TOLOW"><block type="math_number" id="dXu/CLx+$aK5Z#h1ZUKN"><field name="NUM">1</field></block></value><value name="TOHIGH"><block type="math_number" id="Us#ea:MRi4~=^M09?[Me"><field name="NUM">5</field></block></value></block></value><value name="TO"><block type="math_number" id="zXp?Eo:C(P=)kuVJOC0c"><field name="NUM">1</field></block></value><value name="H"><block type="math_arithmetic" id="qiT94G^?^Saa$nO;yk0A"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id=".soU}$3.geuUE!*7^=|I"><value name="VALUE"><block type="variables_get" id="`*m]L#r@XTx7o#b=(W;M"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="MIN"><block type="math_number" id="UtU}+!b;AnIeAMJ_ec-#"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="h7=k}LB+h|r7Li5]c=C@"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="cxKo-jR^LnTxiD((ItMK"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="D=wGqZ|@5$6lC;e{!G^."><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="JRj|-.`5^*`ky(Y3=7;f"><field name="NUM">100</field></block></value><next><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="b78A1pfv9Qi^QKo.G=a!"><field name="OP">OR</field><value name="A"><block type="logic_operation" id="aD#.}m5Y1Y{EHLZE6lZ:"><field name="OP">OR</field><value name="A"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="variables_get" id="x~uYiJr+R@8(@Xh.DW2!"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">25</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="+VjIMSm7HKULsFn2.5P?"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="gw*O:2.0_a_]UI2S5JBq"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="zlb%ws@eXhw-BbpB5PWw"><field name="STATE">LOW</field></block></value></block></value></block></value><value name="B"><block type="sensor_test_state" id="xnN#e?=P2-yVMJDFU5k4"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="O_+s1.:q]JH3_O)o8NU!"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="!eYEY%jyPH!T%dK[E{K."><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="(j-L73Y:ez,cFM[Heu22"><mutation name="Stopp"></mutation><next><block type="procedures_callnoreturn" id="{}_).c[b`;vOFe/5oagX"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="wJmR:}y[)|+mY;K7peE/"><field name="NUM">5</field></block></value><value name="ARG1"><block type="math_number" id="mb@vtU]g_A|-EcOuWldZ"><field name="NUM">500</field></block></value><next><block type="set_pixel_color" id="~=%bcgjNJs-#4vH)7f/7"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="88{gKfFCVobRviBVjiF?"><field name="NUM">4</field></block></value><value name="TO"><block type="math_number" id="Znb3.78UI`ad#hwN{5JL"><field name="NUM">2</field></block></value><value name="H"><block type="math_arithmetic" id="vP55,-zr=E,9*}6k9:T."><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="{UKxjL]js$}u+z6)d9$D"><value name="VALUE"><block type="math_arithmetic" id="|H.hP5?kLJWlkLMM*1gd"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="DVE--(jK10o)vh`~-%v="><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="math_number" id="mce_FVbpi4(;B0AHO/nn"><field name="NUM">3</field></block></value></block></value><value name="MIN"><block type="math_number" id="??c]Jm,,8K5A67oGW57m"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="ZBI?4%DfmY*f([(Dp6Ra"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="M]ZK{M8kTOVGK9~Za=qw"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="D+l}T`Zv~3o=6rlL61]i"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="Tghn{P?3h4VP2{VD(*fB"><field name="NUM">100</field></block></value><next><block type="fast_led" id="?v_,.+iFwYXT~x``gf!2"><next><block type="variables_set" id="6x%h4G?`%D[TqA;#(z/)"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field><value name="VALUE"><block type="variables_get" id="v0PkFZqgc?inqbdb8{sR"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field></block></value><next><block type="procedures_callnoreturn" id="[Bx?=LI:I$:Cy|PFc.-g"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg><arg name="Pause"></arg></mutation><value name="ARG0"><block type="math_number" id="B[=uN:F@tyR?22Qz(8un"><field name="NUM">95</field></block></value><value name="ARG1"><block type="math_number" id=",u3Wm:jXBy]n2}B+~!!~"><field name="NUM">500</field></block></value><next><block type="set_pixel_color" id="s;x=LbYp+Qx5x*gn1ILo"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="_R{UJvcxfoa8Z2H9sjSH"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="*C#$KZ?i~+Db.-+c|U(3"><field name="NUM">2</field></block></value><value name="H"><block type="math_arithmetic" id="/H)3uRyxFMNU0(HA:a%#"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="`Q#lKfwx4O`jYBv^aIo)"><value name="VALUE"><block type="math_arithmetic" id="U,ny]n.(Cn#o;78,9n7{"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="CSbaOCa,?B!tM/jWq)gn"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="B"><block type="math_number" id="P~EY{gx3|4^Q}BBxD3T)"><field name="NUM">3</field></block></value></block></value><value name="MIN"><block type="math_number" id="Fm-c__Kn,%QHLus!X.jE"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="wZi_sG9b/9$3;=lij#C{"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="aY~z%4Dh4p~,x9Ua}{n,"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="T:Px.Xacv}bv(09u-,^T"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="0aI{pxqJLTH^D*2_ZQat"><field name="NUM">100</field></block></value><next><block type="fast_led" id="Q(hUI,;GL4e3::X_Cdp."><next><block type="variables_set" id="ZIa~M5hU3*`Jo.Rz;:A4"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field><value name="VALUE"><block type="variables_get" id="@Sg@#oLa1Gz,pK0h=J@4"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field></block></value><next><block type="logic_if" id="i4~4LGe`X.!8P*%G^OUL"><value name="IF0"><block type="logic_compare" id="2,yMd5g2X5IkP!%#Zyu["><field name="OP">LT</field><value name="A"><block type="variables_get" id=":xyCy|LTmsd/gygZq2E%"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id="Ht9Bz-u0E*+`/{II8eND"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="3heaXlme1MFxGuSXJeWX"><mutation name="Rückwärts 150"></mutation><next><block type="procedures_callnoreturn" id="rooEO0,gc5:EJ;imk?*Q"><mutation name="Drehen links 200"></mutation></block></next></block></statement><next><block type="logic_if" id="11IM+e!;{+2YFS?p[(qP"><value name="IF0"><block type="logic_compare" id="uW.W)@wZe7qq00H~V1-W"><field name="OP">LT</field><value name="A"><block type="variables_get" id="AA.hFtc`}Yhewg!|@th|"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert links</field></block></value><value name="B"><block type="variables_get" id="[!zkGqK1$|n[Osr..Ur{"><field name="VAR" id="_*]V]n-u8(]WTE5aQ.y6">Messwert rechts</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="xmfu)}BCX-0oc[Hu@Dow"><mutation name="Rückwärts 150"></mutation><next><block type="procedures_callnoreturn" id=".y-Wgs1|m2$EjD9RHvOP"><mutation name="Drehen rechts 200"></mutation></block></next></block></statement><next><block type="procedures_callnoreturn" id="uRD0|`1hYtdg^`J#41,L"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="9pyq0#cnre*D(a|2sCxT"><field name="NUM">50</field></block></value><value name="ARG1"><block type="led_pin" id="i[{M9zBZ}qD@!~T4%Nl?"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id=",XX{ri5XLUR|Yc[oRk;W"><value name="DELAY"><block type="math_number" id="wwdKs+=ml{]8aBOgd`)P"><field name="NUM">200</field></block></value></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><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement></block></next></block></next></block></statement></block><block type="basic_comment" id="8zH14(VX/jq@9d3kgK[R" x="2191" y="-443"><field name="COMMENT">Pixelblöcke zur Visualisierung der Messwerte - können auch entfernt werden</field></block><block type="basic_comment" id="7h@`Hu{GxCwUk|IOmz^D" x="3046" y="-326"><field name="COMMENT">Eigentliche Distanzmessung aus der Fahrt heraus. Sie entscheidet, ob eine Umgebungsmessung gemacht werden soll</field></block><block type="basic_comment" id=";.qK,ZnpfbJggS0X@z;A" x="3047" y="-290"><field name="COMMENT">Die klassischen Sensoren, sowie die "oders" können entfernt werden</field></block><block type="basic_comment" id="){KdT{DZ{/SOfza1*75Q" x="2235" y="-236"><field name="COMMENT">Die Umgebungsmessung beinhaltet einen Servo-Befehl und eine Distanzmessung (siehe Unterprogramme). Hier: Umgebungsmessung rechts</field></block><block type="basic_comment" id="XFEa3Tz@etqnuo}1Z_RR" x="2240" y="-98"><field name="COMMENT">Speichere den Messwert für rechts</field></block><block type="basic_comment" id="6_{b)b@]$cMgS1H61JLN" x="2241" y="-60"><field name="COMMENT">Die Umgebungsmessung beinhaltet einen Servo-Befehl und eine Distanzmessung (siehe Unterprogramme). Hier: Umgebungsmessung links</field></block><block type="basic_comment" id="3w{u=x.j0dby!=OjpL{u" x="932" y="106"><field name="COMMENT">Unter- Unterprogramm für Umgebungsmessung</field></block><block type="basic_comment" id="0*$*Ikcja?B2^FiPJ^7w" x="2281" y="75"><field name="COMMENT">Speichere den Messwert für links</field></block><block type="procedures_defnoreturn" id="VRt`=0k8_P/mV9Yxu%AX" x="933" y="153"><mutation><arg name="Servo-Position" varid="|i(*bYM!mN`${xKeP?F`"></arg><arg name="Pause" varid="5xk*8.okpYXB|;B7~8AK"></arg></mutation><field name="NAME">Messe Umgebung</field><statement name="STACK"><block type="procedures_callnoreturn" id="RNUQSrb7PChn(|`v?ckb"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="variables_get" id="sHs_v1uJ1`?U]YBf#(9y"><field name="VAR" id="|i(*bYM!mN`${xKeP?F`">Servo-Position</field></block></value><value name="ARG1"><block type="led_pin" id="}FOno*c:|G!/AA#b[IG_"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="gwB_Cn6;!Zi!%M_*Dn)d"><value name="DELAY"><block type="variables_get" id="wYInTtPK._YQ-#k;g|w~"><field name="VAR" id="5xk*8.okpYXB|;B7~8AK">Pause</field></block></value><next><block type="variables_set" id="|`36zz;O)/$FiB/UI#0l"><field name="VAR" id="F-nCo+j1N;ofMnsD!qPg">Messwert</field><value name="VALUE"><block type="procedures_callreturn" id="4,YMyNt|#[8#-?/kuyQ9"><mutation name="Gemessene Distanz in cm"></mutation></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="sX/qs(glKC,?di6=bZlF" x="2281" y="114"><field name="COMMENT">Vergleiche die beiden Messwerte und ziehe deine Schlüsse daraus für die Weiterfahrt</field></block><block type="basic_comment" id="ClA?^1mR@?F(d/5(i-)A" x="932" y="344"><field name="COMMENT">Unterprogramm für Servo-Position</field></block><block type="procedures_defnoreturn" id="SvD*~(wF:bQ+*pxHBzM`" x="932" y="387"><mutation><arg name="Servo-Position" varid="|i(*bYM!mN`${xKeP?F`"></arg><arg name="Servo Pin" varid="-;pD43ioxfK7?x~,KNH("></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="flow_repeat" id="696u9{gUh%DX=ESZ[8FD"><value name="REPEATS"><block type="math_number" id="VUiY;1;*E7tO_p-ae][@"><field name="NUM">8</field></block></value><statement name="DO"><block type="led_write_state" id="wmPw_VrM1K9l%sKNM/#~"><value name="LED"><block type="variables_get" id="OkF]+(f1;{!r,7wzr0{7"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="Yq(t3{xv*(zD!?PTp?5J"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="kBh?U*!Jxnzp49yveJSb"><value name="DELAY_MICRO"><block type="math_map" id="A5z9ldnV:H/2SH4Qn_me"><value name="VALUE"><block type="variables_get" id="hm3u7#}LZoW_,(`_Xd!d"><field name="VAR" id="|i(*bYM!mN`${xKeP?F`">Servo-Position</field></block></value><value name="FROMLOW"><block type="math_number" id="dS9RH{6ve5y3m.FKa$zh"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="j{0S:qp_n5Q%~NIOM{@f"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="/z+7ZI/E-?mB7pd~N_a]"><field name="NUM">600</field></block></value><value name="TOHIGH"><block type="math_number" id="bRLf238EJ61zRz*pKp;_"><field name="NUM">2400</field></block></value></block></value><next><block type="led_write_state" id="o~J#OtCp({uB0B[s}/X_"><value name="LED"><block type="variables_get" id="!~e?9/=SmSJ{]A]JDc{W"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="7i8m4HZ}b6=,J~6JJIMv"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="c9vn|7uBF-L^e1@}+~;/"><value name="DELAY"><block type="math_number" id="[`]`CAa(t0[Ok2+cA=|d"><field name="NUM">19</field></block></value></block></next></block></next></block></next></block></statement></block></statement></block><block type="basic_comment" id="usd/[F,baJ_g?5#x[e7g" x="1904" y="440"><field name="COMMENT">Fahre vorwärts, falls keine Distanzmessung während der Fahrt bei unter 25cm liegt</field></block><block type="basic_comment" id="_H%wd/-g3M:!s%6:~#sf" x="932" y="703"><field name="COMMENT">Unterprogramme für die Fahrfunktion - die Pausen haben erheblichen Einfluss auf das Verhalten des Roboters. Experimentiere damit!</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="933" y="745"><field name="NAME">Rückwärts 150</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">150</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1267" y="745"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">100</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="S7)$6x0nxoSA:(JO5e;`" x="1612" y="744"><field name="NAME">Stopp</field><statement name="STACK"><block type="motor_write_percentage" id="2V.qqTGpDo8e;Y?+.ox3"><value name="MOTOR"><block type="motor_pin" id="QD9Ad_VT4*D%URD*:~]c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M}8aqPqOp]-}oVRu.98s"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="^8cwA^DoqGmp2LtgR(-7"><value name="MOTOR"><block type="motor_pin" id="2zDs((zJIq4#0io,#j_:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="M@`X=|lF/C=5{JFYv(!h"><field name="NUM">0</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="934" y="930"><field name="NAME">Drehen rechts 200</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">80</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-80</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">250</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="1268" y="926"><field name="NAME">Drehen links 200</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-80</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">80</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">250</field></block></value></block></next></block></next></block></statement></block></xml>

Mit Klick/Berührung XML-Code kopieren und in PGLU-Editor ↗ einfügen
Links Grundversion, rechts Version wie in Video

Selbstfahrendes Auto Level 4: Fahren und Umgebung erkunden

Flussdiagramm Ultraschallsensor Level 4

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</variable><variable id="-;pD43ioxfK7?x~,KNH(">Servo Pin</variable><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="Ca%jcyqP}.scieN@g(#u">Messwert links</variable><variable id="cqnNZty{Uz@f+e-42)6^">Dauer</variable><variable id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</variable></variables><block type="expert_setup" id="(?0[yFjg{z8ktri~0fbH" x="932" y="-894"><statement name="CODE"><block type="motor_write_percentage" id="E^:Q(7zw.^/w)p:%(4Q;"><value name="MOTOR"><block type="motor_pin" id="jQuP]q$AFY_^::JR6hPe"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id=":!,jOtN_IOAU}4t+0`Dy"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="LfRAAAa(awhj.-BImPkS"><value name="MOTOR"><block type="motor_pin" id="+%p8RL:oZt=`T`e5K]+7"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="IS^%v8O0~.XteZH$4a~a"><field name="NUM">0</field></block></value><next><block type="flow_delay" id="d;FV2y_W!.W^@OMZp~4U"><value name="DELAY"><block type="math_number" id="R[HQb=Z_3JZ,z!EuOdVv"><field name="NUM">4000</field></block></value><next><block type="variables_set" id="r/u=Z{oM@tWl?;x_@H(T"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="math_number" id="CJd!bDt_n#f9gmA|d_of"><field name="NUM">0</field></block></value></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id=".a.UK:8{@6|cATc3MtQ+" x="1796" y="-761"><field name="COMMENT">Level 4</field></block><block type="basic_comment" id="GhLmUZ)$$+/7X.A/pu)+" x="1796" y="-715"><field name="COMMENT">Die Grenzwerte Seitenmessung=45cm und Messung geradeaus=20cm beeinflussen die Funktionalität des Roboters erheblich. experimentiere damit</field></block><block type="basic_comment" id="gEMOpjm/Hsgt%C)^##%[" x="932" y="-666"><field name="COMMENT">Unterprogramm Distanzmessung</field></block><block type="basic_comment" id="tnyV.1cG!P+jdseZ$byK" x="1795" y="-678"><field name="COMMENT">Dieser Roboter reagiert sensibler auf die Messungen an den Seitenpositionen, als auf die Messung geradeaus. Siehe Video.</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="933" y="-627"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="flow_delay" id="2P#E]ffIVhNWgvQPfDmF"><value name="DELAY"><block type="math_number" id="[Ku3Dk#!3Kr5OHNnYG.x"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="E8oc@Go?h`Kg!zY]PjFm"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">5</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="V4V6ZXW^t(|9Z3pwXyZ|"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="I3EbbLXq7Zw1mp{gab+="><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_while" id="o@+QZ1AYGEg{i!h*ybp,"><value name="CONDITION"><block type="logic_compare" id="PmYF^4C:CL}R.aVP=A:`"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="MRXi3an0g0MBJYZlICo4"><value name="SENSOR"><block type="sensor_pin" id="WR^5P@YS,1=d^0ust0Be"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="bKVe4bY0@h2)*35T6NyI"><field name="STATE">LOW</field></block></value></block></value><next><block type="variables_set" id="XHHlBre@DF==kBv?!bol"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="flow_micro" id="zRM!cOj{~duB^_J~tJ@x"></block></value><next><block type="flow_while" id="oo7zX.;8G}z+g_z4:~u:"><value name="CONDITION"><block type="logic_compare" id="mhs:q^1%/q7q.AVGnNL,"><field name="OP">EQ</field><value name="A"><block type="sensor_read_state" id="`)7[ACdeA1;x.,tBG|B="><value name="SENSOR"><block type="sensor_pin" id="?Fv*l(scZW;-U_9x3mCQ"><field name="SENSOR">SENSOR3</field></block></value></block></value><value name="B"><block type="basic_digital_state" id="USIOp^ent:b_0#poPpE+"><field name="STATE">HIGH</field></block></value></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field><value name="VALUE"><block type="math_arithmetic" id="@L`]tpuSe%6uA1p[j{jZ"><field name="OP">MINUS</field><value name="A"><block type="flow_micro" id="k].@s|gy*tXvUv$E`rJQ"></block></value><value name="B"><block type="variables_get" id="r3Z#sJzc%dZDH*`h.Ehe"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field></block></value></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Dauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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></next></block></next></block></next></block></statement><value name="RETURN"><block type="variables_get" id="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="basic_comment" id="|Rv%rSo1m!1I/fcyn2qd" x="1117" y="-592"><field name="COMMENT">Wozu diese Pause? Das wissen die Götter aber ohne geht's nicht ;-)</field></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1797" y="-538"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="b`snPGWnE11f_t%{*dOo"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="X|nkgM#;{y*AW-F_66kZ"><field name="NUM">5</field></block></value><next><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="variables_get" id="x~uYiJr+R@8(@Xh.DW2!"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">45</field></block></value></block></value><statement name="DO0"><block type="flow_until" id="TR1N#t[LU;~mb}.x3O:G"><value name="CONDITION"><block type="logic_compare" id="sQUgt;DD^ySQGUb!%M6P"><field name="OP">GT</field><value name="A"><block type="procedures_callreturn" id="|eS15*!jmSDbbOe=7#IB"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="THR#~4wF/Y4l-Qysgf2K"><field name="NUM">40</field></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="M]Cbp^ohRTiY,GLHlR#I"><mutation name="Kurve links"></mutation></block></statement></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement><next><block type="procedures_callnoreturn" id="**XZ@FxQ(CgUS_xRGt);"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="9L%~+|_:~v+-Ddk!Jssc"><field name="NUM">50</field></block></value><next><block type="logic_if" id="~)S/jYCpyq@W0-P5!P.D"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="L{D^.;/l@6]Al%MmpVjv"><field name="OP">LT</field><value name="A"><block type="variables_get" id="`;[g3h{qS}Cs:gV3?H}."><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="1%.o$hOIT2el5NOmdfeg"><field name="NUM">35</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="_Xpg~^Hj^i9siKsoF6C~"><mutation name="Stopp"></mutation><next><block type="procedures_callnoreturn" id="/J_p`Og1(L/I8W@kLRv="><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="Ja0.v.aYKMQ}P{x.fz),"><field name="NUM">95</field></block></value><next><block type="variables_set" id="Do]yZS+*jsfKq?5Dyi(N"><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field><value name="VALUE"><block type="variables_get" id="d2[:~0L0-$HO]leixiM5"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><next><block type="flow_delay" id="1i;=wGQG?KACWZ`G..{o"><value name="DELAY"><block type="math_number" id="[1al=As|tqRZ`dX-QZcu"><field name="NUM">500</field></block></value><next><block type="procedures_callnoreturn" id="N.H-5(19HBf0FmGDQ91|"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="5HEUlK?3)su|%%u8Th#2"><field name="NUM">5</field></block></value><next><block type="variables_set" id=",mO5ad%c9s2:h]K3Dp/S"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field><value name="VALUE"><block type="variables_get" id="?ye:nZqG~w$wJI~OG~0M"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><next><block type="logic_if" id="G(mfLahIy2Wqy(q`j0Jb"><value name="IF0"><block type="logic_compare" id="FI3_kN+JrzY2{CzXv/ko"><field name="OP">LT</field><value name="A"><block type="variables_get" id="4,0H=N.Z.?YjwemJ+uVO"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id=";)XnxXT[xMSzOOfa/7r="><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="{u|#cSuevr*[bDmU:avE"><mutation name="Rückwärts 200"></mutation><next><block type="procedures_callnoreturn" id="?xL^GzknNsk]**hnqnBG"><mutation name="Drehen links 100"></mutation></block></next></block></statement><next><block type="logic_if" id="9c-o}WsN#wxD9}X)gnBg"><value name="IF0"><block type="logic_compare" id="s!/43YcS[b$c6_,vm;@^"><field name="OP">LT</field><value name="A"><block type="variables_get" id="pxSMU.7/A4TTX_KS,6b2"><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field></block></value><value name="B"><block type="variables_get" id="5WRmaqUgmBLX.qn}I~P?"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="1}kKY#dkb]-t!7#j4bXG"><mutation name="Rückwärts 200"></mutation><next><block type="procedures_callnoreturn" id="%Mr2*m~qL@-k~mH#9s?!"><mutation name="Drehen rechts 100"></mutation></block></next></block></statement><next><block type="procedures_callnoreturn" id="^jbAurof:Sc.}pU%h0R4"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="r}pf:jqpaSl/V`t1Y~D("><field name="NUM">50</field></block></value><value name="ARG1"><block type="led_pin" id="?wv@Wj:p2.MmfU8X4Ln*"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="lf%2Y}=Au=qO|CAfj{!:"><value name="DELAY"><block type="math_number" id="_$MK(.4g7I+w9,_$i_vP"><field name="NUM">100</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="cGkP?V0Zq}Q#a*_-zW.L"><mutation name="Vorwärts"></mutation></block></statement><next><block type="procedures_callnoreturn" id="m!h,DIEI{lwwW)7Wa({V"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="(WKpC9?zukqpkMCJCB8}"><field name="NUM">95</field></block></value><next><block type="logic_if" id="odAv3%:bh3;,?7,jJCLx"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id=";l[.L)?5^TeX+nNm[@l,"><field name="OP">LT</field><value name="A"><block type="variables_get" id="mXa{(l`+*fD|2Y4nMOz{"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="q95)~3Hac9r`S:*l%AQ*"><field name="NUM">45</field></block></value></block></value><statement name="DO0"><block type="flow_until" id="gV+*+1WqxP#U]n?$`cVU"><value name="CONDITION"><block type="logic_compare" id="tf?)n}O`_@!%AH2:wp?3"><field name="OP">GT</field><value name="A"><block type="procedures_callreturn" id="%`eq$%7Ak4iUsY4DB-5a"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="Bb,8%P@[G,RFRQHb$D$a"><field name="NUM">40</field></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="L{Fv:}1.wtv(]386y!Xy"><mutation name="Kurve rechts"></mutation></block></statement></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="KHH@r^${:=yF}]@}zZSI"><mutation name="Vorwärts"></mutation></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="SEt/LKJur}vp5mjl1+{K" x="2170" y="-504"><field name="COMMENT">Messe während der Fahrt rechts (an Position 5)</field></block><block type="basic_comment" id="$;!Cv$paSEIdbC$*sPz]" x="2169" y="-462"><field name="COMMENT">Lag die Messung (welche in "Distanz in cm" gespeichert ist) unter 45cm?</field></block><block type="basic_comment" id="{Cvmex|[#B!L,B_bIi0k" x="1996" y="-381"><field name="COMMENT">Wenn ja: Messe weiterhin rechts, bis die Distanz grösser als 40cm wird (sich der Roboter von der seitlichen Wand entfernt hat). Mache in dieser Zeit eine leichte Linkskurve</field></block><block type="basic_comment" id="zf4X(d_Lik`~t/@hC)jt" x="1956" y="-325"><field name="COMMENT">Fahre vorwärts, solange keine Messung unter 45cm lag</field></block><block type="basic_comment" id="VA]mgUE*rtJ;e-Q0+1Y]" x="2201" y="-277"><field name="COMMENT">Messe während der Fahrt geradeaus (an Position 50)</field></block><block type="basic_comment" id="Ih4Rtg%BAIDz;)]mwR{V" x="2201" y="-236"><field name="COMMENT">Lag die Messung geradeaus (welche in "Distanz in cm" gespeichert ist) unter 35cm? wenn ja: Stoppe</field></block><block type="basic_comment" id="16ju-bd[)xBSWs@dUw83" x="2200" y="-193"><field name="COMMENT">Jetzt folgt der selbe Ablauf wie im Programm "Strategie 3": Während dem Stopp wird eine Umgebungsmessung in beide Richtungen gemacht um zu entscheiden, in welche Richtung weitergefahren wird</field></block><block type="basic_comment" id="Cp/9PG-.(B{D34kluMS_" x="2245" y="-127"><field name="COMMENT">Messe Distanz links und speichere den Messwert</field></block><block type="basic_comment" id="U~akq*]Nrt.kPJKc(QPl" x="933" y="44"><field name="COMMENT">Unter- Unterprogramm Umgebungsmessung</field></block><block type="basic_comment" id="irw8[6b9{$x2;@1yUtu9" x="2337" y="-20"><field name="COMMENT">Messe Distanz rechts und speichere den Messwert</field></block><block type="procedures_defnoreturn" id="VRt`=0k8_P/mV9Yxu%AX" x="933" y="87"><mutation><arg name="Servo-Position" varid="CC0tj3|-UpE|@R[-v4)e"></arg></mutation><field name="NAME">Messe Umgebung</field><statement name="STACK"><block type="procedures_callnoreturn" id="RNUQSrb7PChn(|`v?ckb"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="variables_get" id="sHs_v1uJ1`?U]YBf#(9y"><field name="VAR" id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</field></block></value><value name="ARG1"><block type="led_pin" id="}FOno*c:|G!/AA#b[IG_"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="gwB_Cn6;!Zi!%M_*Dn)d"><value name="DELAY"><block type="math_number" id="mb@vtU]g_A|-EcOuWldZ"><field name="NUM">200</field></block></value><next><block type="variables_set" id="|`36zz;O)/$FiB/UI#0l"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert</field><value name="VALUE"><block type="procedures_callreturn" id="4,YMyNt|#[8#-?/kuyQ9"><mutation name="Gemessene Distanz in cm"></mutation></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="/%a[GIgQEMr}3!.NJBUs" x="2335" y="21"><field name="COMMENT">Vergleiche die beiden Messwerte und entscheide, in welche Richtung weitergefahren werden soll</field></block><block type="basic_comment" id="=eu;6ZzQWoBA!7RLg]*3" x="934" y="276"><field name="COMMENT">Unterporgramm Servo-Position</field></block><block type="procedures_defnoreturn" id="SvD*~(wF:bQ+*pxHBzM`" x="932" y="315"><mutation><arg name="Servo-Position" varid="CC0tj3|-UpE|@R[-v4)e"></arg><arg name="Servo Pin" varid="-;pD43ioxfK7?x~,KNH("></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="flow_repeat" id="696u9{gUh%DX=ESZ[8FD"><value name="REPEATS"><block type="math_number" id="VUiY;1;*E7tO_p-ae][@"><field name="NUM">8</field></block></value><statement name="DO"><block type="led_write_state" id="wmPw_VrM1K9l%sKNM/#~"><value name="LED"><block type="variables_get" id="OkF]+(f1;{!r,7wzr0{7"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="Yq(t3{xv*(zD!?PTp?5J"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="kBh?U*!Jxnzp49yveJSb"><value name="DELAY_MICRO"><block type="math_map" id="A5z9ldnV:H/2SH4Qn_me"><value name="VALUE"><block type="variables_get" id="hm3u7#}LZoW_,(`_Xd!d"><field name="VAR" id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</field></block></value><value name="FROMLOW"><block type="math_number" id="dS9RH{6ve5y3m.FKa$zh"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="j{0S:qp_n5Q%~NIOM{@f"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="/z+7ZI/E-?mB7pd~N_a]"><field name="NUM">600</field></block></value><value name="TOHIGH"><block type="math_number" id="bRLf238EJ61zRz*pKp;_"><field name="NUM">2400</field></block></value></block></value><next><block type="led_write_state" id="o~J#OtCp({uB0B[s}/X_"><value name="LED"><block type="variables_get" id="!~e?9/=SmSJ{]A]JDc{W"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="7i8m4HZ}b6=,J~6JJIMv"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="c9vn|7uBF-L^e1@}+~;/"><value name="DELAY"><block type="math_number" id="[`]`CAa(t0[Ok2+cA=|d"><field name="NUM">19</field></block></value></block></next></block></next></block></next></block></statement></block></statement></block><block type="basic_comment" id="p!xj%HXGPUA#8Lnb[Q:U" x="2333" y="254"><field name="COMMENT">Stelle Sensor wieder Geradeaus, bevor du gerade weiterfährst</field></block><block type="basic_comment" id="WR/!YoyYT/!zE)|t{*Zu" x="1959" y="343"><field name="COMMENT">Fahre vorwärts, solange keine Messung unter 35cm lag</field></block><block type="basic_comment" id="n*1NSLU.r#f87h!Sr/7|" x="2160" y="392"><field name="COMMENT">Messe während der Fahrt links (an Position 95)</field></block><block type="basic_comment" id="bDMm-k?kNC/4HU_;wff9" x="2161" y="432"><field name="COMMENT">Lag die Messung (welche in "Distanz in cm" gespeichert ist) unter 45cm?</field></block><block type="basic_comment" id="*8K,(j_:Yh(6Qh7NI.9_" x="1998" y="519"><field name="COMMENT">Wenn ja: Messe weiterhin links, bis die Distanz grösser als 40cm wird (sich der Roboter von der seitlichen Wand entfernt hat). Mache in dieser Zeit eine leichte Rechtskurve</field></block><block type="basic_comment" id="_Kicz[aJht[2HQe}LeYL" x="933" y="622"><field name="COMMENT">Unterprogramme Fahrfunktionen. Die Werte der Pausen beeinflussen die Funktionalität des Roboters erheblich. Experimentiere!</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="934" y="664"><field name="NAME">Rückwärts 200</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1258" y="667"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">70</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">70</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="932" y="849"><field name="NAME">Drehen rechts 100</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">50</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-50</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="Cevs@lk|fJ9RrL-qa#8)" x="1256" y="851"><field name="NAME">Kurve rechts</field><statement name="STACK"><block type="motor_write_percentage" id="nin!YchF-Ip_5{A;!fA/"><value name="MOTOR"><block type="motor_pin" id="T#%pltSpbA;~WH@!I^^N"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="J5j1_t$z3YGM{c*;o@s*"><field name="NUM">80</field></block></value><next><block type="motor_write_percentage" id="P6l36qigVq*s$8q}*.{Z"><value name="MOTOR"><block type="motor_pin" id="*A4OWf?YBMN~w1YJ@cw:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="S=`lhi4BokpAoPE)o_V["><field name="NUM">20</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="931" y="1037"><field name="NAME">Drehen links 100</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-50</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">50</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="|IQo*|rjUZVCBGc=,n_5" x="1257" y="1035"><field name="NAME">Kurve links</field><statement name="STACK"><block type="motor_write_percentage" id="L5,0+VjvJiuENMX,G0[?"><value name="MOTOR"><block type="motor_pin" id="xwP}S[%ZaM]Iiq(qIR+c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="[1,CG{0FWs)eVO#*L0U0"><field name="NUM">20</field></block></value><next><block type="motor_write_percentage" id="WyLPZH.7f5Cx4Y@J*f.6"><value name="MOTOR"><block type="motor_pin" id="lLn:%3DwE+:4HIExcmRB"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="-Cjs~Apk-3yD]S:!@WDj"><field name="NUM">80</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="mKD-@w]jLXbz]`..HIeF" x="1577" y="1039"><field name="NAME">Stopp</field><statement name="STACK"><block type="motor_write_percentage" id="|`]D(jn|@18%B~(a,hEx"><value name="MOTOR"><block type="motor_pin" id="+{Cc2K@_$CQm(!3+Wmy,"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="4r/85YM_0v|dNV?T3Mzh"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="x191.9c?zIQ!`BE#)mxh"><value name="MOTOR"><block type="motor_pin" id="9~[0`[6:nraf/B7|O5w("><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="sI!Oy/fV@JI@.e(SY%`f"><field name="NUM">0</field></block></value></block></next></block></statement></block></xml>

<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</variable><variable id="-;pD43ioxfK7?x~,KNH(">Servo Pin</variable><variable id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</variable><variable id="%G@H{Pj?b=.=1~:%D`!o">Pixel</variable><variable id="svy6^9_ez;A~-G~2gT5p">Messwert</variable><variable id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</variable><variable id="cqnNZty{Uz@f+e-42)6^">Pulsdauer</variable><variable id="Ca%jcyqP}.scieN@g(#u">Messwert links</variable><variable id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</variable></variables><block type="expert_setup" id="(?0[yFjg{z8ktri~0fbH" x="936" y="-1010"><statement name="CODE"><block type="motor_write_percentage" id="eQVC(1iJ8RfiZRGc(xTX"><value name="MOTOR"><block type="motor_pin" id="{A,FZ!:;)lAL[!t_Ks-*"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="LsM)yf_g|WKYk$e3M5Qj"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="$z~t0wBWUlKOR+5Uu53o"><value name="MOTOR"><block type="motor_pin" id="hAZfUv3A#NQ1q]QN-R^6"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id=":KY1IfT%W|L-h)9m{j)L"><field name="NUM">0</field></block></value><next><block type="flow_for" id="9]}S1l;@Ct%)5g[LAHO="><field name="VAR" id="%G@H{Pj?b=.=1~:%D`!o">Pixel</field><value name="FROM"><block type="math_number" id="al?3QRt2vP72c@_D5=}`"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="wuS.hv^x-c*:$F%}Nb_Y"><field name="NUM">16</field></block></value><value name="BY"><block type="math_number" id="Ed_9A.=(t1@j4J0Eo_.c"><field name="NUM">1</field></block></value><statement name="DO"><block type="set_pixel_color" id="8SI:qBR!o5:AMX16cno%"><field name="MODE">MODE1</field><value name="FROM"><block type="variables_get" id="5U3o*#Zp_EAdW+62?z)G"><field name="VAR" id="%G@H{Pj?b=.=1~:%D`!o">Pixel</field></block></value><value name="TO"><block type="math_number" id="kPW+}P%)5GZ,H{vjmko0"><field name="NUM">1</field></block></value><value name="H"><block type="math_arithmetic" id="JH[2LJRqBVK95GWlpPH,"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="0rQJ%4Q5QTy#NyMN#h`$"><field name="VAR" id="%G@H{Pj?b=.=1~:%D`!o">Pixel</field></block></value><value name="B"><block type="math_number" id="]9}KJkm]40YjT*dLn]S}"><field name="NUM">8</field></block></value></block></value><value name="S"><block type="math_number" id="*O[|/Kz$ylja=,gmO~Ko"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="$XJt00gLzIfMyR.LX{y8"><field name="NUM">50</field></block></value><next><block type="flow_delay" id="d;FV2y_W!.W^@OMZp~4U"><value name="DELAY"><block type="math_number" id="R[HQb=Z_3JZ,z!EuOdVv"><field name="NUM">100</field></block></value></block></next></block></statement><next><block type="variables_set" id="r/u=Z{oM@tWl?;x_@H(T"><field name="VAR" id="zF|5YcwF[IrpSgXSTLAg">Zeitstempel</field><value name="VALUE"><block type="math_number" id="CJd!bDt_n#f9gmA|d_of"><field name="NUM">0</field></block></value></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id=".$]$n).#au]fzGyIB*,." x="1796" y="-775"><field name="COMMENT">Level 4</field></block><block type="basic_comment" id="GhLmUZ)$$+/7X.A/pu)+" x="1796" y="-715"><field name="COMMENT">Die Grenzwerte Seitenmessung=45cm und Messung geradeaus=20cm beeinflussen die Funktionalität des Roboters erheblich. experimentiere damit</field></block><block type="basic_comment" id="gEMOpjm/Hsgt%C)^##%[" x="932" y="-666"><field name="COMMENT">Unterprogramm Distanzmessung</field></block><block type="basic_comment" id="tnyV.1cG!P+jdseZ$byK" x="1795" y="-678"><field name="COMMENT">Dieser Roboter reagiert sensibler auf die Messungen an den Seitenpositionen, als auf die Messung geradeaus. Siehe Video.</field></block><block type="procedures_defreturn" id="X*9Bbi%?J)yy1A0,eY)%" x="933" y="-627"><field name="NAME">Gemessene Distanz in cm</field><statement name="STACK"><block type="flow_delay" id="2P#E]ffIVhNWgvQPfDmF"><value name="DELAY"><block type="math_number" id="[Ku3Dk#!3Kr5OHNnYG.x"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="_J7P+|7X.zF:*1O-/vF_"><value name="LED"><block type="led_pin" id="MaJ-Q:N:k6BNDwE;;Vjc"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="6+[/s[IA4ow^gd..p7EW"><field name="CODE_PIN">LOW</field></block></value><next><block type="flow_delay_micro" id="[@TYcycsXOuDh/u2]c(w"><value name="DELAY_MICRO"><block type="math_number" id="!~IE3WZnYj|P)0hVjty?"><field name="NUM">2</field></block></value><next><block type="led_write_state" id="3c-^*^J^9KOl`|YmnyUo"><value name="LED"><block type="led_pin" id="-dbdeQ@J|r_r*Xx`5N6("><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="sG:W$uBtynr-R_Z(-Z-|"><field name="CODE_PIN">HIGH</field></block></value><next><block type="flow_delay_micro" id="~8xP_rW89K[YJ]xMBVZB"><value name="DELAY_MICRO"><block type="math_number" id="k!5P/@3YbBNBOC/8RnPu"><field name="NUM">10</field></block></value><next><block type="led_write_state" id="2;84Lz]_MY(]*an6bbuX"><value name="LED"><block type="led_pin" id="yZ_38:LDC%`}-qs9!#HL"><field name="LED">LED3</field></block></value><value name="VALUE"><block type="code_pin" id="Mp6vJ-a[:g,$6:xi3^O|"><field name="CODE_PIN">LOW</field></block></value><next><block type="variables_set" id="q2[*=,0tFNFH8|0{KMo?"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Pulsdauer</field><value name="VALUE"><block type="code_pin" id="B]zzqRm`RLpqo0@?^lr2"><field name="CODE_PIN">pulseIn(16, HIGH)</field></block></value><next><block type="variables_set" id="^^#D3c@|tS(3]zxatnTI"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field><value name="VALUE"><block type="math_arithmetic" id="Zz]F0P,VWB(nt/;BX7Rw"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="D_s2L~b-kTe3:D]#27[C"><field name="VAR" id="cqnNZty{Uz@f+e-42)6^">Pulsdauer</field></block></value><value name="B"><block type="math_number" id="0J@IlKj[fbutvl*ga7nl"><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="fuVfaNxXyPJ;#)b-Cfqc"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value></block><block type="set_neo_pixel" id="yMuJn+`4#h-0::Js1CeY" x="1795" y="-632"><value name="NUM_LEDS"><block type="math_number" id="(;Yz=u-MV-a:e%ZK!n/x"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="(MH9}CAfUh(7xxyfY`~g"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="GCE@WQc~$;7}#rcBCL:2"><field name="LED">LED1</field></block></value></block><block type="basic_comment" id="|Rv%rSo1m!1I/fcyn2qd" x="1117" y="-592"><field name="COMMENT">Wozu diese Pause? Das wissen die Götter aber ohne geht's nicht ;-)</field></block><block type="basic_main_loop" id="yz(jk1ohuie3{eM082X7" deletable="false" x="1797" y="-538"><value name="BLINK"><block type="basic_blinkcode" id="x4ome(KF{D]/gsL8l-}R"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="b`snPGWnE11f_t%{*dOo"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="X|nkgM#;{y*AW-F_66kZ"><field name="NUM">5</field></block></value><next><block type="set_pixel_color" id="k0!9K6G2@pLCVzSnhOX]"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="10A:(m$^||JJh%6M%C_U"><field name="NUM">13</field></block></value><value name="TO"><block type="math_number" id="zXp?Eo:C(P=)kuVJOC0c"><field name="NUM">4</field></block></value><value name="H"><block type="math_arithmetic" id="qiT94G^?^Saa$nO;yk0A"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id=".soU}$3.geuUE!*7^=|I"><value name="VALUE"><block type="variables_get" id="`*m]L#r@XTx7o#b=(W;M"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert</field></block></value><value name="MIN"><block type="math_number" id="UtU}+!b;AnIeAMJ_ec-#"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="h7=k}LB+h|r7Li5]c=C@"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="cxKo-jR^LnTxiD((ItMK"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="D=wGqZ|@5$6lC;e{!G^."><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="JRj|-.`5^*`ky(Y3=7;f"><field name="NUM">60</field></block></value><next><block type="fast_led" id="?v_,.+iFwYXT~x``gf!2"><next><block type="logic_if" id="9K]#h-C_,BCuv]$+N{Cg"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="aD#.}m5Y1Y{EHLZE6lZ:"><field name="OP">OR</field><value name="A"><block type="logic_compare" id="DEid__]gH-aLq_Mb[coi"><field name="OP">LT</field><value name="A"><block type="variables_get" id="x~uYiJr+R@8(@Xh.DW2!"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="QBF!k?Mj%8LV{U72VgZ8"><field name="NUM">45</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="+VjIMSm7HKULsFn2.5P?"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="gw*O:2.0_a_]UI2S5JBq"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="zlb%ws@eXhw-BbpB5PWw"><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO0"><block type="flow_until" id="TR1N#t[LU;~mb}.x3O:G"><value name="CONDITION"><block type="logic_operation" id="}*]BsDWc]NDYWz!Xv69("><field name="OP">OR</field><value name="A"><block type="logic_compare" id="sQUgt;DD^ySQGUb!%M6P"><field name="OP">GT</field><value name="A"><block type="procedures_callreturn" id="|eS15*!jmSDbbOe=7#IB"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="THR#~4wF/Y4l-Qysgf2K"><field name="NUM">40</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="$_UJIi[UpEe65KbOXE}."><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="(o%s$:v(VnJcbhn1C-3G"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="a-eQ~I*mK:][v);mUWrr"><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="M]Cbp^ohRTiY,GLHlR#I"><mutation name="Kurve links"></mutation></block></statement></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="Ni,Y7T1y9V[,{Y;P(+sm"><mutation name="Vorwärts"></mutation></block></statement><next><block type="procedures_callnoreturn" id="**XZ@FxQ(CgUS_xRGt);"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="9L%~+|_:~v+-Ddk!Jssc"><field name="NUM">50</field></block></value><next><block type="set_pixel_color" id="H5}-.r5R/|{~-jbo;Y(y"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="Ygfe-,4Fw`nYNL=@ENT/"><field name="NUM">5</field></block></value><value name="TO"><block type="math_number" id="#_Z;l7`w+Qf,{O2p$iBd"><field name="NUM">8</field></block></value><value name="H"><block type="math_arithmetic" id="7nXNc)rX-Wpm$]X,.?lx"><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="1uK8R|z5LSDn@8aEPsCa"><value name="VALUE"><block type="variables_get" id="c77As4Wvg^vKoRXf*}kG"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert</field></block></value><value name="MIN"><block type="math_number" id="nq]4t1|H*SX}``Cq-P-e"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="](R8{]A$Ea^U?Dc.8~r|"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="L_z7h!IwK2#4S}$kC3LY"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id="x%+xGY%d%:+yEjOd~9T6"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="JZ,,oMBJYp$O1=0^m*/)"><field name="NUM">60</field></block></value><next><block type="fast_led" id="fX;;=wiX|sIWMoY#En(I"><next><block type="logic_if" id="~)S/jYCpyq@W0-P5!P.D"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="b8Evr;N]0L~OSOLWtKkz"><field name="OP">OR</field><value name="A"><block type="logic_operation" id="(b9Nm%rt55Wj!gc!0mIy"><field name="OP">OR</field><value name="A"><block type="logic_compare" id="L{D^.;/l@6]Al%MmpVjv"><field name="OP">LT</field><value name="A"><block type="variables_get" id="`;[g3h{qS}Cs:gV3?H}."><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="1%.o$hOIT2el5NOmdfeg"><field name="NUM">35</field></block></value></block></value><value name="B"><block type="sensor_test_state" id=".uirjI0Vo6[.fRLXSL*U"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="xi%q-;HOO5zu6F*M/DrF"><field name="SENSOR">SENSOR2</field></block></value><value name="STATE"><block type="basic_digital_state" id="iP!;+h-NR%+rVzKS:4i1"><field name="STATE">LOW</field></block></value></block></value></block></value><value name="B"><block type="sensor_test_state" id="3GXey`PBhr!%Ofg)A*x$"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="nm|zhdi21Lo-6BaTP^H}"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="Q:*;N9|7*_cG/Nrxq*~]"><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="_Xpg~^Hj^i9siKsoF6C~"><mutation name="Stopp"></mutation><next><block type="procedures_callnoreturn" id="/J_p`Og1(L/I8W@kLRv="><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="Ja0.v.aYKMQ}P{x.fz),"><field name="NUM">95</field></block></value><next><block type="variables_set" id="Do]yZS+*jsfKq?5Dyi(N"><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field><value name="VALUE"><block type="variables_get" id="d2[:~0L0-$HO]leixiM5"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><next><block type="flow_delay" id="1i;=wGQG?KACWZ`G..{o"><value name="DELAY"><block type="math_number" id="[1al=As|tqRZ`dX-QZcu"><field name="NUM">500</field></block></value><next><block type="procedures_callnoreturn" id="N.H-5(19HBf0FmGDQ91|"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="5HEUlK?3)su|%%u8Th#2"><field name="NUM">5</field></block></value><next><block type="variables_set" id=",mO5ad%c9s2:h]K3Dp/S"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field><value name="VALUE"><block type="variables_get" id="?ye:nZqG~w$wJI~OG~0M"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><next><block type="logic_if" id="G(mfLahIy2Wqy(q`j0Jb"><value name="IF0"><block type="logic_compare" id="FI3_kN+JrzY2{CzXv/ko"><field name="OP">LT</field><value name="A"><block type="variables_get" id="4,0H=N.Z.?YjwemJ+uVO"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field></block></value><value name="B"><block type="variables_get" id=";)XnxXT[xMSzOOfa/7r="><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="{u|#cSuevr*[bDmU:avE"><mutation name="Rückwärts 200"></mutation><next><block type="procedures_callnoreturn" id="?xL^GzknNsk]**hnqnBG"><mutation name="Drehen links 100"></mutation></block></next></block></statement><next><block type="logic_if" id="9c-o}WsN#wxD9}X)gnBg"><value name="IF0"><block type="logic_compare" id="s!/43YcS[b$c6_,vm;@^"><field name="OP">LT</field><value name="A"><block type="variables_get" id="pxSMU.7/A4TTX_KS,6b2"><field name="VAR" id="Ca%jcyqP}.scieN@g(#u">Messwert links</field></block></value><value name="B"><block type="variables_get" id="5WRmaqUgmBLX.qn}I~P?"><field name="VAR" id="Zjs*ULdl%3e257z{}7_F">Messwert rechts</field></block></value></block></value><statement name="DO0"><block type="procedures_callnoreturn" id="1}kKY#dkb]-t!7#j4bXG"><mutation name="Rückwärts 200"></mutation><next><block type="procedures_callnoreturn" id="%Mr2*m~qL@-k~mH#9s?!"><mutation name="Drehen rechts 100"></mutation></block></next></block></statement><next><block type="procedures_callnoreturn" id="^jbAurof:Sc.}pU%h0R4"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="math_number" id="r}pf:jqpaSl/V`t1Y~D("><field name="NUM">50</field></block></value><value name="ARG1"><block type="led_pin" id="?wv@Wj:p2.MmfU8X4Ln*"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="lf%2Y}=Au=qO|CAfj{!:"><value name="DELAY"><block type="math_number" id="_$MK(.4g7I+w9,_$i_vP"><field name="NUM">100</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="cGkP?V0Zq}Q#a*_-zW.L"><mutation name="Vorwärts"></mutation></block></statement><next><block type="procedures_callnoreturn" id="m!h,DIEI{lwwW)7Wa({V"><mutation name="Messe Umgebung"><arg name="Servo-Position"></arg></mutation><value name="ARG0"><block type="math_number" id="(WKpC9?zukqpkMCJCB8}"><field name="NUM">95</field></block></value><next><block type="set_pixel_color" id="Buw3{py_EYkRCmUdR,G}"><field name="MODE">MODE2</field><value name="FROM"><block type="math_number" id="fC`]@hBqF|jG*!0$!2T*"><field name="NUM">1</field></block></value><value name="TO"><block type="math_number" id="u_yA@uq06*!vFPB4|6O`"><field name="NUM">4</field></block></value><value name="H"><block type="math_arithmetic" id="?0o]h1Zcr7jQv0nN5{.["><field name="OP">MINUS</field><value name="A"><block type="math_constrain" id="+|)a`kV~CvpCnUKn/Yjv"><value name="VALUE"><block type="variables_get" id="fY9R%^;lw3WoCN`hpYL8"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert</field></block></value><value name="MIN"><block type="math_number" id="f`JpST,.@Wr1v!P27QsE"><field name="NUM">30</field></block></value><value name="MAX"><block type="math_number" id="Lz-xhD!uDDPd7agjzc^D"><field name="NUM">150</field></block></value></block></value><value name="B"><block type="math_number" id="*$P76(:yHbVErsgPa(qo"><field name="NUM">30</field></block></value></block></value><value name="S"><block type="math_number" id=";Oyt^NxepDs*ne|4C=`7"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="rxOpUASsCRkp34[`4As,"><field name="NUM">60</field></block></value><next><block type="fast_led" id="Jlv+bn2K3cmYo/)x6_.J"><next><block type="logic_if" id="odAv3%:bh3;,?7,jJCLx"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_operation" id="^kY)Y]D,EUD{7``+-{;("><field name="OP">OR</field><value name="A"><block type="logic_compare" id=";l[.L)?5^TeX+nNm[@l,"><field name="OP">LT</field><value name="A"><block type="variables_get" id="mXa{(l`+*fD|2Y4nMOz{"><field name="VAR" id="bLh6%Kus6UtXUDTn0)wO">Distanz in cm</field></block></value><value name="B"><block type="math_number" id="q95)~3Hac9r`S:*l%AQ*"><field name="NUM">45</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="]!*^*CMTO@r8$!s}91_Z"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id=",!OiLts(l7}YCCAH,=ZO"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="ChcU?/9/xo.q_J0}n/mQ"><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO0"><block type="flow_until" id="gV+*+1WqxP#U]n?$`cVU"><value name="CONDITION"><block type="logic_operation" id="bFwNth}bgxlPFB,r3R5w"><field name="OP">OR</field><value name="A"><block type="logic_compare" id="tf?)n}O`_@!%AH2:wp?3"><field name="OP">GT</field><value name="A"><block type="procedures_callreturn" id="%`eq$%7Ak4iUsY4DB-5a"><mutation name="Gemessene Distanz in cm"></mutation></block></value><value name="B"><block type="math_number" id="Bb,8%P@[G,RFRQHb$D$a"><field name="NUM">40</field></block></value></block></value><value name="B"><block type="sensor_test_state" id="[py}sS)-vij7Qdx@3bNe"><field name="MODE">STANDARD</field><value name="SENSOR"><block type="sensor_pin" id="$.^+e{F=?v*MLdJJXb$I"><field name="SENSOR">SENSOR1</field></block></value><value name="STATE"><block type="basic_digital_state" id="kNi2$zBISa#L0UkP9cw!"><field name="STATE">LOW</field></block></value></block></value></block></value><statement name="DO"><block type="procedures_callnoreturn" id="L{Fv:}1.wtv(]386y!Xy"><mutation name="Kurve rechts"></mutation></block></statement></block></statement><statement name="ELSE"><block type="procedures_callnoreturn" id="KHH@r^${:=yF}]@}zZSI"><mutation name="Vorwärts"></mutation></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></statement></block><block type="basic_comment" id="SEt/LKJur}vp5mjl1+{K" x="2135" y="-506"><field name="COMMENT">Messe während der Fahrt rechts (an Position 5)</field></block><block type="basic_comment" id="MSO4jdP}9Obw(/lxtd4i" x="2637" y="-507"><field name="COMMENT">Die Pixelbefehle visualisieren die Messergebnisse und sind freiwillig</field></block><block type="basic_comment" id="$;!Cv$paSEIdbC$*sPz]" x="2624" y="-364"><field name="COMMENT">Lag die Messung (welche in "Distanz in cm" gespeichert ist) unter 45cm?</field></block><block type="basic_comment" id="r=0CUFAVfmD0A9P$,^Bj" x="2749" y="-308"><field name="COMMENT">Die klassischen Sensorblöcke sind freiwillig</field></block><block type="basic_comment" id="{Cvmex|[#B!L,B_bIi0k" x="1997" y="-256"><field name="COMMENT">Wenn ja: Messe weiterhin rechts, bis die Distanz grösser als 40cm wird (sich der Roboter von der seitlichen Wand entfernt hat). Mache in dieser Zeit eine leichte Linkskurve</field></block><block type="basic_comment" id="zf4X(d_Lik`~t/@hC)jt" x="1951" y="-211"><field name="COMMENT">Fahre vorwärts, solange keine Messung unter 45cm lag</field></block><block type="basic_comment" id="VA]mgUE*rtJ;e-Q0+1Y]" x="2134" y="-161"><field name="COMMENT">Messe während der Fahrt geradeaus (an Position 50)</field></block><block type="basic_comment" id="U~akq*]Nrt.kPJKc(QPl" x="933" y="44"><field name="COMMENT">Unter- Unterprogramm Umgebungsmessung</field></block><block type="basic_comment" id="Ih4Rtg%BAIDz;)]mwR{V" x="3090" y="-30"><field name="COMMENT">Lag die Messung geradeaus (welche in "Distanz in cm" gespeichert ist) unter 35cm? wenn ja: Stoppe</field></block><block type="procedures_defnoreturn" id="VRt`=0k8_P/mV9Yxu%AX" x="933" y="87"><mutation><arg name="Servo-Position" varid="CC0tj3|-UpE|@R[-v4)e"></arg></mutation><field name="NAME">Messe Umgebung</field><statement name="STACK"><block type="procedures_callnoreturn" id="RNUQSrb7PChn(|`v?ckb"><mutation name="stelle Servo"><arg name="Servo-Position"></arg><arg name="Servo Pin"></arg></mutation><value name="ARG0"><block type="variables_get" id="sHs_v1uJ1`?U]YBf#(9y"><field name="VAR" id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</field></block></value><value name="ARG1"><block type="led_pin" id="}FOno*c:|G!/AA#b[IG_"><field name="LED">LED2</field></block></value><next><block type="flow_delay" id="gwB_Cn6;!Zi!%M_*Dn)d"><value name="DELAY"><block type="math_number" id="mb@vtU]g_A|-EcOuWldZ"><field name="NUM">200</field></block></value><next><block type="variables_set" id="|`36zz;O)/$FiB/UI#0l"><field name="VAR" id="svy6^9_ez;A~-G~2gT5p">Messwert</field><value name="VALUE"><block type="procedures_callreturn" id="4,YMyNt|#[8#-?/kuyQ9"><mutation name="Gemessene Distanz in cm"></mutation></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="16ju-bd[)xBSWs@dUw83" x="2238" y="44"><field name="COMMENT">Jetzt folgt der selbe Ablauf wie im Programm "Strategie 3": Während dem Stopp wird eine Umgebungsmessung in beide Richtungen gemacht um zu entscheiden, in welche Richtung weitergefahren wird</field></block><block type="basic_comment" id="Cp/9PG-.(B{D34kluMS_" x="2239" y="76"><field name="COMMENT">Messe Distanz links und speichere den Messwert</field></block><block type="basic_comment" id="irw8[6b9{$x2;@1yUtu9" x="2242" y="172"><field name="COMMENT">Messe Distanz rechts und speichere den Messwert</field></block><block type="basic_comment" id="=eu;6ZzQWoBA!7RLg]*3" x="934" y="276"><field name="COMMENT">Unterporgramm Servo-Position</field></block><block type="procedures_defnoreturn" id="SvD*~(wF:bQ+*pxHBzM`" x="932" y="315"><mutation><arg name="Servo-Position" varid="CC0tj3|-UpE|@R[-v4)e"></arg><arg name="Servo Pin" varid="-;pD43ioxfK7?x~,KNH("></arg></mutation><field name="NAME">stelle Servo</field><statement name="STACK"><block type="flow_repeat" id="696u9{gUh%DX=ESZ[8FD"><value name="REPEATS"><block type="math_number" id="VUiY;1;*E7tO_p-ae][@"><field name="NUM">8</field></block></value><statement name="DO"><block type="led_write_state" id="wmPw_VrM1K9l%sKNM/#~"><value name="LED"><block type="variables_get" id="OkF]+(f1;{!r,7wzr0{7"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="Yq(t3{xv*(zD!?PTp?5J"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="kBh?U*!Jxnzp49yveJSb"><value name="DELAY_MICRO"><block type="math_map" id="A5z9ldnV:H/2SH4Qn_me"><value name="VALUE"><block type="variables_get" id="hm3u7#}LZoW_,(`_Xd!d"><field name="VAR" id="CC0tj3|-UpE|@R[-v4)e">Servo-Position</field></block></value><value name="FROMLOW"><block type="math_number" id="dS9RH{6ve5y3m.FKa$zh"><field name="NUM">0</field></block></value><value name="FROMHIGH"><block type="math_number" id="j{0S:qp_n5Q%~NIOM{@f"><field name="NUM">100</field></block></value><value name="TOLOW"><block type="math_number" id="/z+7ZI/E-?mB7pd~N_a]"><field name="NUM">600</field></block></value><value name="TOHIGH"><block type="math_number" id="bRLf238EJ61zRz*pKp;_"><field name="NUM">2400</field></block></value></block></value><next><block type="led_write_state" id="o~J#OtCp({uB0B[s}/X_"><value name="LED"><block type="variables_get" id="!~e?9/=SmSJ{]A]JDc{W"><field name="VAR" id="-;pD43ioxfK7?x~,KNH(">Servo Pin</field></block></value><value name="VALUE"><block type="basic_digital_state" id="7i8m4HZ}b6=,J~6JJIMv"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="c9vn|7uBF-L^e1@}+~;/"><value name="DELAY"><block type="math_number" id="[`]`CAa(t0[Ok2+cA=|d"><field name="NUM">19</field></block></value></block></next></block></next></block></next></block></statement></block></statement></block><block type="basic_comment" id="/%a[GIgQEMr}3!.NJBUs" x="2328" y="249"><field name="COMMENT">Vergleiche die beiden Messwerte und entscheide, in welche Richtung weitergefahren werden soll</field></block><block type="basic_comment" id="p!xj%HXGPUA#8Lnb[Q:U" x="2319" y="483"><field name="COMMENT">Stelle Sensor wieder Geradeaus, bevor du gerade weiterfährst</field></block><block type="basic_comment" id="_Kicz[aJht[2HQe}LeYL" x="933" y="622"><field name="COMMENT">Unterprogramme Fahrfunktionen. Die Werte der Pausen beeinflussen die Funktionalität des Roboters erheblich. Experimentiere!</field></block><block type="basic_comment" id="X~t~M?`@^||js7%SO}B=" x="1954" y="574"><field name="COMMENT">Fahre vorwärts, solange keine Messung unter 20cm lag</field></block><block type="procedures_defnoreturn" id="^lRBfqCpdae[i_}e9M.@" x="934" y="664"><field name="NAME">Rückwärts 200</field><statement name="STACK"><block type="motor_write_percentage" id="=(wRXI574Ks)|IYH+rN|"><value name="MOTOR"><block type="motor_pin" id="V4p:!/%-~XCY?[[ZyzD|"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3%6x9(Pfv32QKqgMnH{l"><field name="NUM">-100</field></block></value><next><block type="motor_write_percentage" id="s{5po-(#fhA]]HxUKpD!"><value name="MOTOR"><block type="motor_pin" id="[Kd#xG~rg(1`I`TASubj"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="78!$;naXwMSY7R$;!2ac"><field name="NUM">-100</field></block></value><next><block type="flow_delay" id="8w`/n{WVdf=$g}Y[[SfA"><value name="DELAY"><block type="math_number" id="[GKav.)/e_fN]~MB[Kyb"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="0/u{N[hliKC.iD$Vo#r_" x="1258" y="667"><field name="NAME">Vorwärts</field><statement name="STACK"><block type="motor_write_percentage" id="k^Amt;{6v*9[)v.cJibK"><value name="MOTOR"><block type="motor_pin" id="w;r;J.fn6-5~L2H]HZT-"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="3rkhK-Bx!OZjV=RAi)2X"><field name="NUM">70</field></block></value><next><block type="motor_write_percentage" id="5S:0F1{uUC#g~0$HBm31"><value name="MOTOR"><block type="motor_pin" id="?XFGUOH(i#zeYly3fT7L"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="WR_QvGk:%kRfWnTkR]um"><field name="NUM">70</field></block></value></block></next></block></statement></block><block type="basic_comment" id="n*1NSLU.r#f87h!Sr/7|" x="2132" y="624"><field name="COMMENT">Messe während der Fahrt links (an Position 95)</field></block><block type="procedures_defnoreturn" id="bYFUOO*TcgaX472Q+~-!" x="932" y="849"><field name="NAME">Drehen rechts 100</field><statement name="STACK"><block type="motor_write_percentage" id="ZY[l-CbAYii!eju([;fK"><value name="MOTOR"><block type="motor_pin" id="yA4*a99hfn|kWB/M/1kU"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="p.1Lc%95hMYBMCNAJgrL"><field name="NUM">50</field></block></value><next><block type="motor_write_percentage" id="*Bew?$3UD@}fy!jRG=o?"><value name="MOTOR"><block type="motor_pin" id=".DzbyP4aR7]/H|q5F?G~"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="B=T:2pIgek_p^rZx`Rvc"><field name="NUM">-50</field></block></value><next><block type="flow_delay" id="#SV/sg7T$+sWtq?8-Gbr"><value name="DELAY"><block type="math_number" id="50mlP8GcWbQkF/}dXXQ*"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="basic_comment" id="bDMm-k?kNC/4HU_;wff9" x="2625" y="765"><field name="COMMENT">Lag die Messung (welche in "Distanz in cm" gespeichert ist) unter 45cm?</field></block><block type="procedures_defnoreturn" id="Cevs@lk|fJ9RrL-qa#8)" x="1256" y="851"><field name="NAME">Kurve rechts</field><statement name="STACK"><block type="motor_write_percentage" id="nin!YchF-Ip_5{A;!fA/"><value name="MOTOR"><block type="motor_pin" id="T#%pltSpbA;~WH@!I^^N"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="J5j1_t$z3YGM{c*;o@s*"><field name="NUM">80</field></block></value><next><block type="motor_write_percentage" id="P6l36qigVq*s$8q}*.{Z"><value name="MOTOR"><block type="motor_pin" id="*A4OWf?YBMN~w1YJ@cw:"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="S=`lhi4BokpAoPE)o_V["><field name="NUM">20</field></block></value></block></next></block></statement></block><block type="basic_comment" id="*8K,(j_:Yh(6Qh7NI.9_" x="2752" y="816"><field name="COMMENT">Wenn ja: Messe weiterhin links, bis die Distanz grösser als 40cm wird (sich der Roboter von der seitlichen Wand entfernt hat). Mache in dieser Zeit eine leichte Rechtskurve</field></block><block type="basic_comment" id="WR/!YoyYT/!zE)|t{*Zu" x="1948" y="915"><field name="COMMENT">Fahre vorwärts, solange keine Messung unter 45cm lag</field></block><block type="procedures_defnoreturn" id="nUskS]o|h1s^C#ZEnH#H" x="931" y="1037"><field name="NAME">Drehen links 100</field><statement name="STACK"><block type="motor_write_percentage" id="e=irXPE?-^]{X;}!tx9k"><value name="MOTOR"><block type="motor_pin" id="l7y0[:yL5M=S,)Hx:.=t"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="u3JLnv@`lk7h~_3Cfu?#"><field name="NUM">-50</field></block></value><next><block type="motor_write_percentage" id="7s~sd3C0Ng?h?@~8E6S)"><value name="MOTOR"><block type="motor_pin" id="qb]Toiqo|b*0fHjcd~gD"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="?^FcwVGumQdz/j{L$O[h"><field name="NUM">50</field></block></value><next><block type="flow_delay" id="L)Vhm-1P#;s,udJCwB?`"><value name="DELAY"><block type="math_number" id="!^sd~_yCw:kP;wZwhJc$"><field name="NUM">200</field></block></value></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="|IQo*|rjUZVCBGc=,n_5" x="1257" y="1035"><field name="NAME">Kurve links</field><statement name="STACK"><block type="motor_write_percentage" id="L5,0+VjvJiuENMX,G0[?"><value name="MOTOR"><block type="motor_pin" id="xwP}S[%ZaM]Iiq(qIR+c"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="[1,CG{0FWs)eVO#*L0U0"><field name="NUM">20</field></block></value><next><block type="motor_write_percentage" id="WyLPZH.7f5Cx4Y@J*f.6"><value name="MOTOR"><block type="motor_pin" id="lLn:%3DwE+:4HIExcmRB"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="-Cjs~Apk-3yD]S:!@WDj"><field name="NUM">80</field></block></value></block></next></block></statement></block><block type="procedures_defnoreturn" id="mKD-@w]jLXbz]`..HIeF" x="1577" y="1039"><field name="NAME">Stopp</field><statement name="STACK"><block type="motor_write_percentage" id="|`]D(jn|@18%B~(a,hEx"><value name="MOTOR"><block type="motor_pin" id="+{Cc2K@_$CQm(!3+Wmy,"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="4r/85YM_0v|dNV?T3Mzh"><field name="NUM">0</field></block></value><next><block type="motor_write_percentage" id="x191.9c?zIQ!`BE#)mxh"><value name="MOTOR"><block type="motor_pin" id="9~[0`[6:nraf/B7|O5w("><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="sI!Oy/fV@JI@.e(SY%`f"><field name="NUM">0</field></block></value></block></next></block></statement></block></xml>

Mit Klick/Berührung XML-Code kopieren und in PGLU-Editor ↗ einfügen
Links Grundversion, rechts Version wie in Video