3 – Mit Fahrroboter einer Linie folgen (Linefollower)

3

Mit Fahrroboter einer Linie folgen (Linefollower)

Das lernst du hier

Dieser Linefollower kann einer Linie folgen, egal, ob die Linie hell und der Boden dunkel ist oder umgekehrt, denn selbst bei geringen Helligkeitsunterschieden funktioniert der Roboter. Vorausgesetzt natürlich, du stellst den Lichtsensor richtig ein! So kannst du sogar mit normalem Malerklebband einen Parcours kleben und herausfinden, wer den schnellsten Roboter programmiert hat. Wer fällt am wenigsten aus der Kurve?

3a

Das Linefollower-Modul einbauen

Wie geht das?

Das Linefollower-Modul besteht aus einem Fotowiderstand (LDR) und einer Leuchtdiode (LED). Diese sind so angeordnet, dass die LED den Boden beleuchtet und der LDR die Lichtreflexion vom Boden misst: Er kann dadurch sehen, ob die Fläche darunter heller oder dunkler ist.

Verstehe hier, wie das Modul angeschlossen wird:

Verstehe auch im 3D-Modell, wie das Linefollower angeschlossen wird. Hier geht’s zum 3D-Modell ↓.

3b

Einfache, aber langsame Version

Wie geht das?

Dein Linefollower fährt immer genau einer Grenze (Kante) zwischen einer hellen und einer dunklen Fläche entlang.

> Sieht der Fotowidestand eine helle Fläche, lenkt er den Roboter in die dunkle Fläche.
> Sieht der Fotowiederstand eine dunkle Fläche, lenkt er den Roboter in die helle Fläche.

Challenge:

Challenge: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="e5X.ECwIulvrLP9O0]*?">Schwellenwert hell-dunkel</variable></variables><block type="basic_comment" id="752`vHWb9AviD*(.[y.v" x="134" y="-42"><field name="COMMENT">Schwellenwert zwischen hell und dunkel.&amp;#10;Experimentiere damit!</field></block><block type="variables_set" id="ymxu4S6^a.VU5Qv82#RV" x="444" y="-40"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Schwellenwert hell-dunkel</field><value name="VALUE"><block type="math_number" id="5/~6_:K9{+1,K/3f[.a0"><field name="NUM">50</field></block></value></block><block type="basic_comment" id="/11t(ikP@^J4;Y^tMv}(" x="1056" y="-44"><field name="COMMENT">FAHRROBOTER Challenge 3b Linefollower "einfach aber langsam"&amp;#10;&amp;#10;Setze die Blöcke in den Hauptloop ein. Wenn du mehr Blöcke brauchst, findest du sie im Menu</field></block><block type="basic_comment" id="3(xP|5r*WhLH%J~OQPCg" x="63" y="86"><field name="COMMENT">Frage, ob die Helligkeit grösser als der Schwellenwert ist</field></block><block type="logic_if" id="s4`}h$bfPR_fOHxvWmVI" x="441" y="76"><value name="IF0"><block type="logic_compare" id="d/51rnX]}FS$v(N?7?w`"><field name="OP">GT</field><value name="A"><block type="sensor_read_percentage" id="MHFpYKSU_},NO|xd54R!"><value name="SENSOR"><block type="sensor_pin" id="}S#63IN0doJ29G30F+[c"><field name="SENSOR">SENSOR4</field></block></value></block></value><value name="B"><block type="math_number" id="-4qb[2O~4~(/zkU2Oyf|"><field name="NUM">50</field></block></value></block></value></block><block type="basic_main_loop" id="8Np#B)0Vf^SF*=TW~5k/" deletable="false" x="1055" y="69"><value name="BLINK"><block type="basic_blinkcode" id="W.$!O{rF:YlxA}+Dr!t+"><field name="SHORT">1</field><field name="LONG">1</field></block></value></block><block type="basic_comment" id=".g/IXNaYv`/hTFirbkay" x="61" y="224"><field name="COMMENT">Frage, ob die Helligkeit kleiner als der Schwellenwert ist</field></block><block type="logic_if" id="*6~vI8|=-uFV_7$t`ySJ" x="447" y="219"><value name="IF0"><block type="logic_compare" id="$gmIrz=*Rf:AYxd$h|P:"><field name="OP">LT</field><value name="A"><block type="sensor_read_percentage" id="?R/4T.d`7|U^znns/.O("><value name="SENSOR"><block type="sensor_pin" id="$-;q#Zi#Zgn+]=4q76X`"><field name="SENSOR">SENSOR4</field></block></value></block></value><value name="B"><block type="math_number" id="GUx][by,`Lf(GH{2E4dJ"><field name="NUM">50</field></block></value></block></value></block><block type="basic_comment" id="zLF[7.l0=7Gh-}P4O$BW" x="272" y="372"><field name="COMMENT">fahre eine Linkskurve</field></block><block type="motor_write_percentage" id="T^Axd%O|e%wb!w#BH5[r" x="450" y="372"><value name="MOTOR"><block type="motor_pin" id="4$)K{m1I,AFmMqZ`JX:("><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id=";bSt?nVBBSYO6:sgCN?s"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="69RRHkW8xcArl,BfNdsD"><value name="MOTOR"><block type="motor_pin" id="+L089:}e0Mdf,USQ6X]O"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="cQJd}Zd%UI][Q!hp5%1:"><field name="NUM">60</field></block></value></block></next></block><block type="basic_comment" id="A+XQ@Bp.GK2ytaiDhHx]" x="155" y="421"><field name="COMMENT">Experimentiere mit der ENGE dieser Kurve!</field></block><block type="motor_write_percentage" id="O|Bs4bY{H5AhqUvny`lZ" x="452" y="523"><value name="MOTOR"><block type="motor_pin" id="RIVF33Y,Hv`hYh.q6(0U"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_q]85GiF:B?O@](XC{d#"><field name="NUM">60</field></block></value><next><block type="motor_write_percentage" id="`bY%l_veE0_h;-}Y280y"><value name="MOTOR"><block type="motor_pin" id="Bn]{3TUa2bG(;E;meVYd"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_YWHfxW_RafL8Zh9u(N6"><field name="NUM">100</field></block></value></block></next></block><block type="basic_comment" id="TraciD$^FDq,R)[@TU}x" x="258" y="546"><field name="COMMENT">fahre eine Rechtskurve</field></block></xml>

Mögliche Lösung:

Lösung: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="e5X.ECwIulvrLP9O0]*?">Schwellenwert hell-dunkel</variable></variables><block type="basic_comment" id="/11t(ikP@^J4;Y^tMv}(" x="1056" y="-44"><field name="COMMENT">FAHRROBOTER Challenge 3b Linefollower "einfach aber langsam"&amp;#10;&amp;#10;Setze die Blöcke in den Hauptloop ein. Wenn du mehr Blöcke brauchst, findest du sie im Menu</field></block><block type="basic_comment" id="752`vHWb9AviD*(.[y.v" x="775" y="81"><field name="COMMENT">Schwellenwert zwischen hell und dunkel.&amp;#10;Experimentiere damit!</field></block><block type="basic_main_loop" id="8Np#B)0Vf^SF*=TW~5k/" deletable="false" x="1055" y="69"><value name="BLINK"><block type="basic_blinkcode" id="W.$!O{rF:YlxA}+Dr!t+"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="ymxu4S6^a.VU5Qv82#RV"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Schwellenwert hell-dunkel</field><value name="VALUE"><block type="math_number" id="5/~6_:K9{+1,K/3f[.a0"><field name="NUM">50</field></block></value><next><block type="logic_if" id="s4`}h$bfPR_fOHxvWmVI"><value name="IF0"><block type="logic_compare" id="d/51rnX]}FS$v(N?7?w`"><field name="OP">GT</field><value name="A"><block type="sensor_read_percentage" id="MHFpYKSU_},NO|xd54R!"><value name="SENSOR"><block type="sensor_pin" id="}S#63IN0doJ29G30F+[c"><field name="SENSOR">SENSOR4</field></block></value></block></value><value name="B"><block type="math_number" id="-4qb[2O~4~(/zkU2Oyf|"><field name="NUM">50</field></block></value></block></value><statement name="DO0"><block type="motor_write_percentage" id="T^Axd%O|e%wb!w#BH5[r"><value name="MOTOR"><block type="motor_pin" id="4$)K{m1I,AFmMqZ`JX:("><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id=";bSt?nVBBSYO6:sgCN?s"><field name="NUM">100</field></block></value><next><block type="motor_write_percentage" id="69RRHkW8xcArl,BfNdsD"><value name="MOTOR"><block type="motor_pin" id="+L089:}e0Mdf,USQ6X]O"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="cQJd}Zd%UI][Q!hp5%1:"><field name="NUM">60</field></block></value></block></next></block></statement><next><block type="logic_if" id="*6~vI8|=-uFV_7$t`ySJ"><value name="IF0"><block type="logic_compare" id="$gmIrz=*Rf:AYxd$h|P:"><field name="OP">LT</field><value name="A"><block type="sensor_read_percentage" id="?R/4T.d`7|U^znns/.O("><value name="SENSOR"><block type="sensor_pin" id="$-;q#Zi#Zgn+]=4q76X`"><field name="SENSOR">SENSOR4</field></block></value></block></value><value name="B"><block type="math_number" id="GUx][by,`Lf(GH{2E4dJ"><field name="NUM">50</field></block></value></block></value><statement name="DO0"><block type="motor_write_percentage" id="O|Bs4bY{H5AhqUvny`lZ"><value name="MOTOR"><block type="motor_pin" id="RIVF33Y,Hv`hYh.q6(0U"><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_q]85GiF:B?O@](XC{d#"><field name="NUM">60</field></block></value><next><block type="motor_write_percentage" id="`bY%l_veE0_h;-}Y280y"><value name="MOTOR"><block type="motor_pin" id="Bn]{3TUa2bG(;E;meVYd"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_number" id="_YWHfxW_RafL8Zh9u(N6"><field name="NUM">100</field></block></value></block></next></block></statement></block></next></block></next></block></statement></block><block type="basic_comment" id="3(xP|5r*WhLH%J~OQPCg" x="681" y="147"><field name="COMMENT">Frage, ob die Helligkeit grösser als der Schwellenwert ist</field></block><block type="basic_comment" id="zLF[7.l0=7Gh-}P4O$BW" x="886" y="186"><field name="COMMENT">fahre eine Linkskurve</field></block><block type="basic_comment" id=".g/IXNaYv`/hTFirbkay" x="684" y="283"><field name="COMMENT">Frage, ob die Helligkeit kleiner als der Schwellenwert ist</field></block><block type="basic_comment" id="TraciD$^FDq,R)[@TU}x" x="878" y="322"><field name="COMMENT">fahre eine Rechtskurve</field></block><block type="basic_comment" id="A+XQ@Bp.GK2ytaiDhHx]" x="767" y="361"><field name="COMMENT">Experimentiere mit der ENGE dieser Kurve!</field></block></xml>
3c

Erweiterte und schnellere Version

Wie geht das?

Der Linefollower aus Challenge 3a funktioniert mit einem harten Schwellenwert, der darüber entscheidet, ob das Fahrzeug eine Links- oder eine Rechtskurve macht. Dieser Roboter kann dadurch nie geradeaus fahren.

Dein LDR kann aber auch Zwischenstufen der Helligkeit messen und erkennen, ob er sich näher oder weiter von der Helligkeitsgrenze befindet. So kann er die Motoren stufenweise beeinflussen, was seine Fahrt flüssiger macht.

Verstehe das Programm und spiele mit den Werten. Verstehe auch, warum die Sensoren kalibriert werden müssen!

Mögliche Lösung:

Lösung: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</variable><variable id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</variable><variable id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</variable><variable id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</variable><variable id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</variable></variables><block type="basic_comment" id="}-f:#U01Ek)0.IWe;4Kx" x="287" y="-39"><field name="COMMENT">Bei jedem Programmstart werden die Helligkeit der Linie und der Fläche&amp;#10;gemessen und in einer Variable gespeichert&amp;#10;&amp;#10;Dank dieser Kalibrierung des Sensors funktioniert der Roboter auch,&amp;#10;wenn Linie und Fläche nicht perfekt schwarz-weiss sind!</field></block><block type="basic_comment" id="/11t(ikP@^J4;Y^tMv}(" x="1057" y="-43"><field name="COMMENT">FAHRROBOTER Challenge 3c Linefollower "erweitert und schneller" mit Pixeln&amp;#10;&amp;#10;Setze die Blöcke in den Hauptloop ein. Wenn du mehr Blöcke brauchst, findest du sie im Menu</field></block><block type="expert_setup" id="6EqTgEz](vjyVG(ja9i;" x="289" y="107"><statement name="CODE"><block type="led_write_state" id="xVT4h_+~$G,OL?V=2u)/"><value name="LED"><block type="led_pin" id="mSorZUd%f{1^Sj[O/`f{"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="]#B(r3Ev42buVYkU(%4q"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="zL8RS%PuYci;RG|y.sv{"><value name="LED"><block type="led_pin" id="FNWs]PV+)G10v=;Hl1cC"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="(sIjzq+N%.6Gpj6;/PuO"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="}Yf2I7w/o8-(o:i#+%P3"><value name="DELAY"><block type="math_number" id="2ps$,%:Z[BcabgjiPR[d"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="=B{qbq_[SAF$?}43,9Ec"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="Q}11iTxGX3;+wBb#ZWE*"><value name="SENSOR"><block type="sensor_pin" id="gNuMP=z+NVhX$B}uLMtm"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="w2L+`zmUdGfT?f?6XL0)"><value name="LED"><block type="led_pin" id="2-K82~#BX!O%J^R@j`:]"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="2;qWF;`xa~Qz:cMg*2Y8"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="OY!3V`Kr|}t+~npJ8Q%h"><value name="LED"><block type="led_pin" id="3MA|cZFWUv2@[`n*~%L6"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="H=aOz,LSGdac%d)[?nE="><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="+/!Z$QK6m42{sgkss||9"><value name="DELAY"><block type="math_number" id="H*sacOmRlxWU]_~%~LMJ"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="ENRG]}_BAYfUE(=;dBT1"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="$yYmzYp*Hme7ZtL]^@vi"><value name="SENSOR"><block type="sensor_pin" id=",1oJzZ##XB06,~B4QOo-"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="];:6{wd=5JgV.Q:?/`Em"><value name="LED"><block type="led_pin" id="K${|_Vz#g)pQ@CLYpxXE"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="bh`HdM4wKg*tG1jNcWat"><field name="STATE">HIGH</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_main_loop" id="8Np#B)0Vf^SF*=TW~5k/" deletable="false" x="1055" y="69"><value name="BLINK"><block type="basic_blinkcode" id="W.$!O{rF:YlxA}+Dr!t+"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="`m9^xrNLhQmN}q)`Z4bT"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field><value name="VALUE"><block type="sensor_read_percentage" id="foOn5`6kLS[6+x=4GpDr"><value name="SENSOR"><block type="sensor_pin" id="F5VC-0Lalv}MMHBCYLB["><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="variables_set" id="Mo$,*JvLkEJJiNlBuR2j"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field><value name="VALUE"><block type="math_map" id="7WMc]B1X)Fd=Gh.ZTR!@"><value name="VALUE"><block type="variables_get" id="gzSaR2QaGD0Pk$RlHWj1"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="2z,KVk=g}-PYV@Se=)zd"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="(S(RvI(bj3c0Mdb:t_z;"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="0j//auM81=7;S$)n*l9)"><field name="NUM">30</field></block></value><value name="TOHIGH"><block type="math_number" id="eZR_@~z1X@nvMnx=Yv#j"><field name="NUM">90</field></block></value></block></value><next><block type="variables_set" id="8/v/D[!3p9N@?kPlMkbB"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field><value name="VALUE"><block type="math_map" id="om#U}aPcdJAG|l=V!=ZW"><value name="VALUE"><block type="variables_get" id=":X@mKXM/71FCGyY-gkNb"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="zDA5sf{VlL0K)Fq2%qjM"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="LDH0d7M^VXSfATEn4M*3"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="eF*J=Tui2r1IsIgO@XN7"><field name="NUM">90</field></block></value><value name="TOHIGH"><block type="math_number" id="N|~X.x.rjYal/IN7)md5"><field name="NUM">30</field></block></value></block></value><next><block type="motor_write_percentage" id="T^Axd%O|e%wb!w#BH5[r"><value name="MOTOR"><block type="motor_pin" id="4$)K{m1I,AFmMqZ`JX:("><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="apjx2!5:C+]nWf)*!u}a"><value name="VALUE"><block type="variables_get" id="kO)sBH{5R-4w^c~dHBJ|"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field></block></value><value name="MIN"><block type="math_number" id="BlIL^3W,YGc0mWZJeW~u"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="~wWMd[gQo+~UhXH=a4OW"><field name="NUM">100</field></block></value></block></value><next><block type="motor_write_percentage" id="*5Zm3Hpmwlb5EN4Uc7*|"><value name="MOTOR"><block type="motor_pin" id="3$E!?sc0f*,tH`B^(u)m"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="MIQ-*Sc)4Je2f4@8:=j["><value name="VALUE"><block type="variables_get" id="}sw[mJo7;rN`(,|VluYQ"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field></block></value><value name="MIN"><block type="math_number" id=")Ww;F+,p1btXp8mpFW3!"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="By*a)RXV~6=QU?zhxQaB"><field name="NUM">100</field></block></value></block></value></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="-9ul1;XxJTX~3UVZ?}F+" x="1731" y="100"><field name="COMMENT">experimentiere mit diesen Werten, sie machen den Roboter schneller, aber er fällt auch schneller aus der Kurve</field></block><block type="basic_comment" id="c~Gj$Ru~zzX=LDbqcVQR" x="596" y="187"><field name="COMMENT">Bei Signal LED1: Sensor über dunkle Fläche halten</field></block><block type="basic_comment" id=")yuL2)PC@dT;r4S]yftc" x="595" y="350"><field name="COMMENT">Bei Signal LED2: Sensor über helle Fläche halten</field></block></xml>
3d

Sensorwerte mit Pixeln anzeigen

Wie geht das?

Um die Justierung des Linefollowers zu vereinfachen, sollen die Messwerte des Fotowiderstands mit Pixeln angezeigt werden. Das geht mit einem Pixel Stripe oder mit einer Matrix (hier im Bild).

Die Anzeige soll so funktionieren: Wenn der Fotowiderstand 0% Licht misst, soll Pixel 1 leuchten und wenn er 100% Licht misst, soll Pixel 16 leuchten.

Im Bild hier leuchtet Pixel 6, was einem Helligkeitswert von 40% entspricht.

Challenge:

Challenge: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</variable><variable id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</variable><variable id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</variable><variable id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</variable><variable id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</variable></variables><block type="basic_comment" id="/11t(ikP@^J4;Y^tMv}(" x="1053" y="-150"><field name="COMMENT">FAHRROBOTER Challenge 3d Linefollower "erweitert und schneller" mit Pixeln&amp;#10;&amp;#10;Setze die Blöcke in den Hauptloop ein. Wenn du mehr Blöcke brauchst, findest du sie im Menu</field></block><block type="basic_comment" id="}-f:#U01Ek)0.IWe;4Kx" x="287" y="-39"><field name="COMMENT">Bei jedem Programmstart werden die Helligkeit der Linie und der Fläche&amp;#10;gemessen und in einer Variable gespeichert&amp;#10;&amp;#10;Dank dieser Kalibrierung des Sensors funktioniert der Roboter auch,&amp;#10;wenn Linie und Fläche nicht perfekt schwarz-weiss sind!</field></block><block type="set_neo_pixel" id="dP;)`/JQqdpoZcH_x?;2" x="1053" y="-49"><value name="NUM_LEDS"><block type="math_number" id="^$UhKTI%MD;@?P(PD=z{"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="5i{XNnj#l760Ij`74Aya"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="ynE=-XkH!;V9n?MiDMFx"><field name="LED">LED1</field></block></value></block><block type="expert_setup" id="6EqTgEz](vjyVG(ja9i;" x="289" y="107"><statement name="CODE"><block type="led_write_state" id="xVT4h_+~$G,OL?V=2u)/"><value name="LED"><block type="led_pin" id="mSorZUd%f{1^Sj[O/`f{"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="]#B(r3Ev42buVYkU(%4q"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="zL8RS%PuYci;RG|y.sv{"><value name="LED"><block type="led_pin" id="FNWs]PV+)G10v=;Hl1cC"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="(sIjzq+N%.6Gpj6;/PuO"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="}Yf2I7w/o8-(o:i#+%P3"><value name="DELAY"><block type="math_number" id="2ps$,%:Z[BcabgjiPR[d"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="=B{qbq_[SAF$?}43,9Ec"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="Q}11iTxGX3;+wBb#ZWE*"><value name="SENSOR"><block type="sensor_pin" id="gNuMP=z+NVhX$B}uLMtm"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="w2L+`zmUdGfT?f?6XL0)"><value name="LED"><block type="led_pin" id="2-K82~#BX!O%J^R@j`:]"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="2;qWF;`xa~Qz:cMg*2Y8"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="OY!3V`Kr|}t+~npJ8Q%h"><value name="LED"><block type="led_pin" id="3MA|cZFWUv2@[`n*~%L6"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="H=aOz,LSGdac%d)[?nE="><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="+/!Z$QK6m42{sgkss||9"><value name="DELAY"><block type="math_number" id="H*sacOmRlxWU]_~%~LMJ"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="ENRG]}_BAYfUE(=;dBT1"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="$yYmzYp*Hme7ZtL]^@vi"><value name="SENSOR"><block type="sensor_pin" id=",1oJzZ##XB06,~B4QOo-"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="];:6{wd=5JgV.Q:?/`Em"><value name="LED"><block type="led_pin" id="K${|_Vz#g)pQ@CLYpxXE"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="bh`HdM4wKg*tG1jNcWat"><field name="STATE">HIGH</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_main_loop" id="8Np#B)0Vf^SF*=TW~5k/" deletable="false" x="1055" y="69"><value name="BLINK"><block type="basic_blinkcode" id="W.$!O{rF:YlxA}+Dr!t+"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="`m9^xrNLhQmN}q)`Z4bT"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field><value name="VALUE"><block type="sensor_read_percentage" id="foOn5`6kLS[6+x=4GpDr"><value name="SENSOR"><block type="sensor_pin" id="F5VC-0Lalv}MMHBCYLB["><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="variables_set" id="Mo$,*JvLkEJJiNlBuR2j"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field><value name="VALUE"><block type="math_map" id="7WMc]B1X)Fd=Gh.ZTR!@"><value name="VALUE"><block type="variables_get" id="gzSaR2QaGD0Pk$RlHWj1"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="2z,KVk=g}-PYV@Se=)zd"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="(S(RvI(bj3c0Mdb:t_z;"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="0j//auM81=7;S$)n*l9)"><field name="NUM">30</field></block></value><value name="TOHIGH"><block type="math_number" id="eZR_@~z1X@nvMnx=Yv#j"><field name="NUM">90</field></block></value></block></value><next><block type="variables_set" id="8/v/D[!3p9N@?kPlMkbB"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field><value name="VALUE"><block type="math_map" id="om#U}aPcdJAG|l=V!=ZW"><value name="VALUE"><block type="variables_get" id=":X@mKXM/71FCGyY-gkNb"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="zDA5sf{VlL0K)Fq2%qjM"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="LDH0d7M^VXSfATEn4M*3"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="eF*J=Tui2r1IsIgO@XN7"><field name="NUM">90</field></block></value><value name="TOHIGH"><block type="math_number" id="N|~X.x.rjYal/IN7)md5"><field name="NUM">30</field></block></value></block></value><next><block type="motor_write_percentage" id="T^Axd%O|e%wb!w#BH5[r"><value name="MOTOR"><block type="motor_pin" id="4$)K{m1I,AFmMqZ`JX:("><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="apjx2!5:C+]nWf)*!u}a"><value name="VALUE"><block type="variables_get" id="kO)sBH{5R-4w^c~dHBJ|"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field></block></value><value name="MIN"><block type="math_number" id="BlIL^3W,YGc0mWZJeW~u"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="~wWMd[gQo+~UhXH=a4OW"><field name="NUM">100</field></block></value></block></value><next><block type="motor_write_percentage" id="*5Zm3Hpmwlb5EN4Uc7*|"><value name="MOTOR"><block type="motor_pin" id="3$E!?sc0f*,tH`B^(u)m"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="MIQ-*Sc)4Je2f4@8:=j["><value name="VALUE"><block type="variables_get" id="}sw[mJo7;rN`(,|VluYQ"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field></block></value><value name="MIN"><block type="math_number" id=")Ww;F+,p1btXp8mpFW3!"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="By*a)RXV~6=QU?zhxQaB"><field name="NUM">100</field></block></value></block></value></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="-9ul1;XxJTX~3UVZ?}F+" x="1664" y="52"><field name="COMMENT">experimentiere mit diesen Werten, sie machen den Roboter schneller, aber er fällt auch schneller aus der Kurve</field></block><block type="basic_comment" id="c~Gj$Ru~zzX=LDbqcVQR" x="596" y="187"><field name="COMMENT">Bei Signal LED1: Sensor über dunkle Fläche halten</field></block><block type="basic_comment" id=")yuL2)PC@dT;r4S]yftc" x="595" y="350"><field name="COMMENT">Bei Signal LED2: Sensor über helle Fläche halten</field></block><block type="set_pixel_color" id="~-fZttYxF6UHb#JMtl{k" x="1054" y="468"><field name="MODE">MODE1</field><value name="TO"><block type="math_number" id="8r49o^Hp?c0xvNsy_uCq"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="]].UcPbbuj2$Ge=1C+P^"><field name="NUM">20</field></block></value><value name="S"><block type="math_number" id="rw_}hfBE%9,vE?E%U`(1"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="*{S4?J94X;x,~cxG,/zG"><field name="NUM">100</field></block></value></block><block type="math_arithmetic" id="%15uE~u#5HW==lA@XHy9" x="1046" y="539"><field name="OP">MULTIPLY</field></block><block type="math_number" id="[qzAeLzZ0H_grsROKlZQ" x="1046" y="597"><field name="NUM">0.16</field></block><block type="variables_get" id="MDcrCiWvQw@v/C|;C,Y%" x="1047" y="652"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field></block><block type="basic_comment" id=")pO{J%Bi8aOPkZ1,zha/" x="1053" y="723"><field name="COMMENT">Indem der Sensorwert in % mit 0.16 multipliziert wird, kann der Messbereich von 0% - 100% auf &amp;#10;die 16 Pixel skaliert werden.&amp;#10;&amp;#10;Spiele auch mit den Farben und der Anzahl Pixel!&amp;#10;&amp;#10;Für Cracks: schaffst du es, die restlichen Pixel in einer Hintergrundfarbe leuchten zu lassen?&amp;#10;Orientiere dich an Code aus Aufgabe 4 unter PGLU.CH/MATRIX</field></block></xml>

Mögliche Lösung:

Lösung: XML-Code in Editor einfügen
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</variable><variable id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</variable><variable id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</variable><variable id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</variable><variable id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</variable></variables><block type="basic_comment" id="/11t(ikP@^J4;Y^tMv}(" x="1053" y="-150"><field name="COMMENT">FAHRROBOTER Challenge 3d Linefollower "erweitert und schneller" mit Pixeln&amp;#10;&amp;#10;Setze die Blöcke in den Hauptloop ein. Wenn du mehr Blöcke brauchst, findest du sie im Menu</field></block><block type="basic_comment" id="}-f:#U01Ek)0.IWe;4Kx" x="287" y="-39"><field name="COMMENT">Bei jedem Programmstart werden die Helligkeit der Linie und der Fläche&amp;#10;gemessen und in einer Variable gespeichert&amp;#10;&amp;#10;Dank dieser Kalibrierung des Sensors funktioniert der Roboter auch,&amp;#10;wenn Linie und Fläche nicht perfekt schwarz-weiss sind!</field></block><block type="set_neo_pixel" id="dP;)`/JQqdpoZcH_x?;2" x="1053" y="-49"><value name="NUM_LEDS"><block type="math_number" id="^$UhKTI%MD;@?P(PD=z{"><field name="NUM">16</field></block></value><value name="BRIGHTNESS"><block type="math_number" id="5i{XNnj#l760Ij`74Aya"><field name="NUM">50</field></block></value><value name="OUTTURN"><block type="led_pin" id="oK2wQrY^i2f47`4)#Vy8"><field name="LED">LED1</field></block></value></block><block type="expert_setup" id="6EqTgEz](vjyVG(ja9i;" x="289" y="107"><statement name="CODE"><block type="led_write_state" id="xVT4h_+~$G,OL?V=2u)/"><value name="LED"><block type="led_pin" id="mSorZUd%f{1^Sj[O/`f{"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="]#B(r3Ev42buVYkU(%4q"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="zL8RS%PuYci;RG|y.sv{"><value name="LED"><block type="led_pin" id="FNWs]PV+)G10v=;Hl1cC"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="(sIjzq+N%.6Gpj6;/PuO"><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="}Yf2I7w/o8-(o:i#+%P3"><value name="DELAY"><block type="math_number" id="2ps$,%:Z[BcabgjiPR[d"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="=B{qbq_[SAF$?}43,9Ec"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="Q}11iTxGX3;+wBb#ZWE*"><value name="SENSOR"><block type="sensor_pin" id="gNuMP=z+NVhX$B}uLMtm"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="w2L+`zmUdGfT?f?6XL0)"><value name="LED"><block type="led_pin" id="2-K82~#BX!O%J^R@j`:]"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="2;qWF;`xa~Qz:cMg*2Y8"><field name="STATE">HIGH</field></block></value><next><block type="led_write_state" id="OY!3V`Kr|}t+~npJ8Q%h"><value name="LED"><block type="led_pin" id="3MA|cZFWUv2@[`n*~%L6"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="H=aOz,LSGdac%d)[?nE="><field name="STATE">LOW</field></block></value><next><block type="flow_delay" id="+/!Z$QK6m42{sgkss||9"><value name="DELAY"><block type="math_number" id="H*sacOmRlxWU]_~%~LMJ"><field name="NUM">3000</field></block></value><next><block type="variables_set" id="ENRG]}_BAYfUE(=;dBT1"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field><value name="VALUE"><block type="sensor_read_percentage" id="$yYmzYp*Hme7ZtL]^@vi"><value name="SENSOR"><block type="sensor_pin" id=",1oJzZ##XB06,~B4QOo-"><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="led_write_state" id="];:6{wd=5JgV.Q:?/`Em"><value name="LED"><block type="led_pin" id="K${|_Vz#g)pQ@CLYpxXE"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="bh`HdM4wKg*tG1jNcWat"><field name="STATE">HIGH</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_main_loop" id="8Np#B)0Vf^SF*=TW~5k/" deletable="false" x="1055" y="69"><value name="BLINK"><block type="basic_blinkcode" id="W.$!O{rF:YlxA}+Dr!t+"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="variables_set" id="`m9^xrNLhQmN}q)`Z4bT"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field><value name="VALUE"><block type="sensor_read_percentage" id="foOn5`6kLS[6+x=4GpDr"><value name="SENSOR"><block type="sensor_pin" id="F5VC-0Lalv}MMHBCYLB["><field name="SENSOR">SENSOR4</field></block></value></block></value><next><block type="variables_set" id="Mo$,*JvLkEJJiNlBuR2j"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field><value name="VALUE"><block type="math_map" id="7WMc]B1X)Fd=Gh.ZTR!@"><value name="VALUE"><block type="variables_get" id="gzSaR2QaGD0Pk$RlHWj1"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="2z,KVk=g}-PYV@Se=)zd"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="(S(RvI(bj3c0Mdb:t_z;"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="0j//auM81=7;S$)n*l9)"><field name="NUM">30</field></block></value><value name="TOHIGH"><block type="math_number" id="eZR_@~z1X@nvMnx=Yv#j"><field name="NUM">90</field></block></value></block></value><next><block type="variables_set" id="8/v/D[!3p9N@?kPlMkbB"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field><value name="VALUE"><block type="math_map" id="om#U}aPcdJAG|l=V!=ZW"><value name="VALUE"><block type="variables_get" id=":X@mKXM/71FCGyY-gkNb"><field name="VAR" id="Gs|;%*HN;qxtVzV^tUq.">gemessene Helligkeit</field></block></value><value name="FROMLOW"><block type="variables_get" id="zDA5sf{VlL0K)Fq2%qjM"><field name="VAR" id="e5X.ECwIulvrLP9O0]*?">Referenz dunkle Fläche</field></block></value><value name="FROMHIGH"><block type="variables_get" id="LDH0d7M^VXSfATEn4M*3"><field name="VAR" id="mU^cU0QhENgx}(lrG*AF">Referenz helle Fläche</field></block></value><value name="TOLOW"><block type="math_number" id="eF*J=Tui2r1IsIgO@XN7"><field name="NUM">90</field></block></value><value name="TOHIGH"><block type="math_number" id="N|~X.x.rjYal/IN7)md5"><field name="NUM">30</field></block></value></block></value><next><block type="motor_write_percentage" id="T^Axd%O|e%wb!w#BH5[r"><value name="MOTOR"><block type="motor_pin" id="4$)K{m1I,AFmMqZ`JX:("><field name="MOTOR">MOTOR1</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="apjx2!5:C+]nWf)*!u}a"><value name="VALUE"><block type="variables_get" id="kO)sBH{5R-4w^c~dHBJ|"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field></block></value><value name="MIN"><block type="math_number" id="BlIL^3W,YGc0mWZJeW~u"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="~wWMd[gQo+~UhXH=a4OW"><field name="NUM">100</field></block></value></block></value><next><block type="motor_write_percentage" id="*5Zm3Hpmwlb5EN4Uc7*|"><value name="MOTOR"><block type="motor_pin" id="3$E!?sc0f*,tH`B^(u)m"><field name="MOTOR">MOTOR2</field></block></value><value name="PERCENTAGE"><block type="math_constrain" id="MIQ-*Sc)4Je2f4@8:=j["><value name="VALUE"><block type="variables_get" id="}sw[mJo7;rN`(,|VluYQ"><field name="VAR" id="L*,Lm~j066Po-2kQ60e9">Tempo rechtes Rad</field></block></value><value name="MIN"><block type="math_number" id=")Ww;F+,p1btXp8mpFW3!"><field name="NUM">0</field></block></value><value name="MAX"><block type="math_number" id="By*a)RXV~6=QU?zhxQaB"><field name="NUM">100</field></block></value></block></value><next><block type="set_pixel_color" id="~-fZttYxF6UHb#JMtl{k"><field name="MODE">MODE1</field><value name="FROM"><block type="math_arithmetic" id="%15uE~u#5HW==lA@XHy9"><field name="OP">MULTIPLY</field><value name="A"><block type="variables_get" id="MDcrCiWvQw@v/C|;C,Y%"><field name="VAR" id="c]cnDp/xGcTEwOsaWX-]">Tempo linkes Rad</field></block></value><value name="B"><block type="math_number" id="[qzAeLzZ0H_grsROKlZQ"><field name="NUM">0.16</field></block></value></block></value><value name="TO"><block type="math_number" id="8r49o^Hp?c0xvNsy_uCq"><field name="NUM">1</field></block></value><value name="H"><block type="math_number" id="]].UcPbbuj2$Ge=1C+P^"><field name="NUM">20</field></block></value><value name="S"><block type="math_number" id="rw_}hfBE%9,vE?E%U`(1"><field name="NUM">100</field></block></value><value name="B"><block type="math_number" id="*{S4?J94X;x,~cxG,/zG"><field name="NUM">100</field></block></value></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_comment" id="-9ul1;XxJTX~3UVZ?}F+" x="1664" y="52"><field name="COMMENT">experimentiere mit diesen Werten, sie machen den Roboter schneller, aber er fällt auch schneller aus der Kurve</field></block><block type="basic_comment" id="c~Gj$Ru~zzX=LDbqcVQR" x="596" y="187"><field name="COMMENT">Bei Signal LED1: Sensor über dunkle Fläche halten</field></block><block type="basic_comment" id=")yuL2)PC@dT;r4S]yftc" x="595" y="350"><field name="COMMENT">Bei Signal LED2: Sensor über helle Fläche halten</field></block><block type="basic_comment" id=")pO{J%Bi8aOPkZ1,zha/" x="1053" y="450"><field name="COMMENT">Indem der Sensorwert in % mit 0.16 multipliziert wird, kann der Messbereich von 0% - 100% auf &amp;#10;die 16 Pixel skaliert werden.&amp;#10;&amp;#10;Spiele auch mit den Farben und der Anzahl Pixel!&amp;#10;&amp;#10;Für Cracks: schaffst du es, die restlichen Pixel in einer Hintergrundfarbe leuchten zu lassen?&amp;#10;Orientiere dich an Code aus Aufgabe 4 unter PGLU.CH/MATRIX</field></block></xml>

Weitere Challenges

> Wer baut den schnellsten Linefollower, der gleichzeitig enge Kurven fahren kann?
> Kann der Roboter auf der geraden Strecke schneller sein, als in der Kurve?
> Wie schaffst du es, dass das Fahrzeug beim Verlieren der Linie selber wieder darauf zurückfindet?
> Erfinde eigene Challenges.

Anforderung:
✓ Mittel bis erweitert
✓ Bauen ohne Werkstatt
✓ Mehrmals bauen und zerlegen

Thema:
> Sensor steuert Motor
> Sensor steuert Licht
> Einfacher Programmablauf mit Bedingung
> Neopixel
> Werte in Variablen speichern

Werkzeug:
> Lötstation

Material:
> Bausatz pglu.ch/shop > Arduino Roboter
> pglu.ch/shop > Mikrocontroller KOMFORT oder MOTOR
> pglu.ch/shop > Elektronik > MATRIX

Anleitung Roboter:
> Roboter bauen: TTG PROJEKT > ARDUINO ROBOTER > BAU
> Elektronik anschliessen: TTG PROJEKT > ARDUINO ROBOTER > BAU
> Roboter programmieren: TTG PROJEKT> ARDUINO ROBOTER > CODING

Anleitung LED & Neopixel
> Neopixel anschliessen: TTG PROJEKT > NEOPIXEL > BAU

3D-Modell:
> Hier anschauen

Videos:
> Roboter: vimeo.com / 835 204 272
> Neopixel Matrix: TTG PROJEKT > NEOPIXEL MATRIX > CODING

Basics:
> Lernumgebung aufbauen: pglu.ch > ANLEITUNG
> XML in Editor importieren: pglu.ch > ANLEITUNG > EDITOR

Editor:
> Online: mach.pglu.ch
> Teacher’s Box: mach.pglu.box

Erweiterungen:
> Matrix Designer: TTG PROJEKT > NEOPIXEL MATRIX > CODING
> Ultraschallsensor: workshop.pglu.ch > SENSOR
> Weiteres: pglu.ch > HILFREICHE DOKUMENTE
> Erweiterung mit KI: ki-kit.ch