IMG_20200529_103819-scaled.jpg

Du bist hier: Aktor > Piezzo Element

Arduino Piezo Element

1. Vorbereiten

Das Piezzo Element kann als Sensor oder Aktor an dein Arduino angeschlossen werden. Du kannst damit einfache Sounds kreieren oder Vibrationen messen.

Um das Piezzo Element als Buzzer zu verwenden, musst du es direkt in einen der vier LED-Ausgänge des PGLU-Mikrocontrollers einschrauben. Polung beachten. Klebe das Piezoelement auf einen Resonanzkörper. Im Video wurde ein einfacher Plastikbecher verwendet. Teste, was am besten klingt.

  • Hinweis: Piezoelemente können auch mit der Mikrocontroller "Pixel" angesteuert werden. Es können bis zu 4 Piezoelemente angeschlossen werden

2. Programmieren

Die Programmierung ist denkbar einfach. Der LED-Ausgang wird in sehr kurzen Abständen ein- und ausgeschaltet. Dazwischen wird eine sehr kurze Pause von wenigen μs eingesetzt.

  • 1 Mikrosekunde = 1/1'000 Millisekunde = 1/1'000'000 Sekunde

2.1. Programmierung einfacher Ton

Sketch 1: Arduino Piezo Element als Buzzer programmieren. Einfacher Ton
Video Thumbnail
Piezo Element Buzzer "Testsound"
Piezo Element Buzzer "Testsound"

2.2. Sketch: Sweep Sound

Sketch 2: Arduino Piezo Element als Buzzer programmieren. Sweep Sound
Video Thumbnail
Piezo Element als Buzzer "Sweep Sound"
Piezo Element als Arduino Buzzer mit PGLU-Mikrocontroller. Sweep Sound.

2.3. Sketch: Melodie "Alli mini Äntli"

Sketch 3: Arduino Piezo Element mit Tonleiter (Klick für Zoom)
Video Thumbnail
Piezo Element Buzzer "Ali mini Äntli"
Piezo Element Buzzer "Ali mini Äntli"

Für das vollständige Lied "Alli mini Äntli", kopiere den untenstehenden XML-Code in den PGLU-Editor und wandle ihn in die grafische Darstellung um.

<xml xmlns="http://www.w3.org/1999/xhtml"><variables><variable type="" id="[|eRHsX0nrHe=T2pki}x">Frequenz</variable><variable type="" id="S|PJQN4+d,by}%/vgoOS">x</variable><variable type="" id="q1EK=P3Pr^S]*5l|v](N">Länge</variable><variable type="" id="2Fx/dUvZ(-R}A!jmOp[f">Dauer</variable></variables><block type="basic_main_loop" id="}Uv^ljo8%{bpam,]`pv9" deletable="false" x="-931" y="-701"><value name="BLINK"><block type="basic_blinkcode" id="KI3qY)zZZS)^g@+zo-ba"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="?}.bj!FCJnuY2Gqa%X7%"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="n*AS8oAk`1=2Qlm2C,ut"><field name="NUM">600</field></block></value><value name="ARG1"><block type="math_number" id="+h0J0QZ21%l|u.~s}LY_"><field name="NUM">400</field></block></value><next><block type="procedures_callnoreturn" id="2jV~HfR^?Y=n!M=ap~t#"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="VAuI/G2:9L]w!Jpa]e41"><field name="NUM">530</field></block></value><value name="ARG1"><block type="math_number" id="-Bpu8]j0M4k7jD,=d{x!"><field name="NUM">450</field></block></value><next><block type="procedures_callnoreturn" id="z~Z?eNO{x`HG5n1Gj8N6"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="|B)9{kbhJb0(yl|W8ea="><field name="NUM">470</field></block></value><value name="ARG1"><block type="math_number" id="nj7)TSn.D2N3p!zEU8:{"><field name="NUM">500</field></block></value><next><block type="procedures_callnoreturn" id="1HjZ(S4aeF(QM`1|p-We"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id=")PI(-loQC4!S)Kzg6CsJ"><field name="NUM">448</field></block></value><value name="ARG1"><block type="math_number" id="QcDA@v~90@-[Ypd`!NBp"><field name="NUM">550</field></block></value><next><block type="flow_delay" id="PHUb=rM7[R?A%^WW~hK1"><value name="DELAY"><block type="math_number" id="V$?K#nc|vI@Hku.5_`4("><field name="NUM">10</field></block></value><next><block type="procedures_callnoreturn" id="c$3.b[cv8F6bM4Ybqn[|"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="F(tk)Jkn[aV-)P^EsH11"><field name="NUM">400</field></block></value><value name="ARG1"><block type="math_number" id="I`+Au@d?OK%ul*#SvVT@"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="}c^43-bcg0u@.lOI~Mp5"><value name="DELAY"><block type="math_number" id="[{*PrI*-7iX)X=9T[FYP"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="tz/t|/w0/{oRa.lz~lhH"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="+Kz%{j_xJE(svYs*6_v#"><field name="NUM">400</field></block></value><value name="ARG1"><block type="math_number" id="e?d7:;T{X1E)J`~hf[y1"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="I_:FDjuan_Ad[W=]G12-"><value name="DELAY"><block type="math_number" id="NFw9|*92r|Kq.;LbQ3@e"><field name="NUM">300</field></block></value><next><block type="procedures_callnoreturn" id="{NykV-TuQez,dLyMh9(J"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="Td?@!vmQU,P!S4PnZ$dJ"><field name="NUM">350</field></block></value><value name="ARG1"><block type="math_number" id="4{Ccm]E6TIW[wVSqLij~"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="ir.%9qcdVU^o177uHjO#"><value name="DELAY"><block type="math_number" id="3yFGl;o}ga](IviMzL;F"><field name="NUM">200</field></block></value><next><block type="procedures_callnoreturn" id="e1^Ic]Ro7JSe1$xguJBu"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="R3]xywk1J%5L,41YZ/%D"><field name="NUM">350</field></block></value><value name="ARG1"><block type="math_number" id="ma*`Dma__8Kl:v20oP:a"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="1%mF;j_p}4kTL6tp,zY*"><value name="DELAY"><block type="math_number" id="u!/pay(|dsfv|j9tb4x%"><field name="NUM">200</field></block></value><next><block type="procedures_callnoreturn" id=",CJk|^R#eA/C%$qtzyz|"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="y2OXatCTT=K^XJ[3.FYk"><field name="NUM">350</field></block></value><value name="ARG1"><block type="math_number" id="I=Cmla2aj,h4}nc8z9q!"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="o(_(SXt5gS=,OGbb}Vv|"><value name="DELAY"><block type="math_number" id="_j0~NQd0thwH*`j#A;]:"><field name="NUM">200</field></block></value><next><block type="procedures_callnoreturn" id="op-F_}^22ME|j^s`SWB@"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="6R1,%vzJJRZtjTne?P`?"><field name="NUM">350</field></block></value><value name="ARG1"><block type="math_number" id="t_WnrifhJ9+Z/}vvW~er"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="}Ad%c[04XEXl7_v#[Sr!"><value name="DELAY"><block type="math_number" id="#|%g/u]L(%ORP7wxe=v~"><field name="NUM">200</field></block></value><next><block type="procedures_callnoreturn" id="BfC^6bLK?6bc,zo$y|g^"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="b#I!338+sF41rOPN~X@Q"><field name="NUM">400</field></block></value><value name="ARG1"><block type="math_number" id="cvMh1t7*0#$f@DkB:6%l"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="!z2crh!X^byk3Gh(MXwH"><value name="DELAY"><block type="math_number" id="IY1`Ble,4?0dyBb2}*[o"><field name="NUM">600</field></block></value><next><block type="procedures_callnoreturn" id="pw^F*JiSU,rz9b[$[Gl8"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="KR-tX%=-o,6)P?Ftv#Dx"><field name="NUM">450</field></block></value><value name="ARG1"><block type="math_number" id="*l+a{g?}fEqFpbvh*^1("><field name="NUM">400</field></block></value><next><block type="flow_delay" id="zpJ.Dfe+)?.RG67TD.!X"><value name="DELAY"><block type="math_number" id="k}[xABByT(s1li6KtYM;"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="H8Y:/jg=`wB_=~I4_{Cs"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="D7@%tY.Z,kiG6Te:Ok;["><field name="NUM">450</field></block></value><value name="ARG1"><block type="math_number" id="zUX_7cdSdyx3H~jrJ~g_"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="ZQqK6jDAK4=3;P/*8p^#"><value name="DELAY"><block type="math_number" id="Owut,LMy%1b/73ww+k?a"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="aLBmg(-cp)E~87dv)J6G"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id=",NJp!pnf7!wkpByk%r|^"><field name="NUM">450</field></block></value><value name="ARG1"><block type="math_number" id="edL1yl;3-5*iL4D{R}?o"><field name="NUM">400</field></block></value><next><block type="flow_delay" id=".7dAG7EHWgW^+`bL!T3U"><value name="DELAY"><block type="math_number" id="iKlwVJ,dA(8wz(bD-[x-"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="+QDuY=62=_u/E`7fSVhe"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="y*3CGrh8vuLAsVbLU,II"><field name="NUM">450</field></block></value><value name="ARG1"><block type="math_number" id="?V3Zn@I1,$k+/7J.frpJ"><field name="NUM">400</field></block></value><next><block type="flow_delay" id="i2Do2QtLY+^8?wpG;GBD"><value name="DELAY"><block type="math_number" id="4Mh1kUc}|Gm*Sph}1nCi"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="NLz_glucT$TkC64c`S;g"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="y6,1CK].(e[nJG*xEymc"><field name="NUM">470</field></block></value><value name="ARG1"><block type="math_number" id="!VA`Z]J/|%0U/[@z%~C%"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="yWX?!)zV5nZ=]Hngfno$"><value name="DELAY"><block type="math_number" id="!Lp!sHH2@WR8{~`rCGL0"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="o:.}pjuV@8Dcrpv$X}ZB"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="Fx-ga6ejv)P9`8D~=4~1"><field name="NUM">470</field></block></value><value name="ARG1"><block type="math_number" id="@D1M5uV~}_EW6(i[BqYy"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="]WVvb!mPGq=BqNapiB)T"><value name="DELAY"><block type="math_number" id="FqAle`L`4AcjT2rfm%14"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="Hkv16FLJX5V$0D!z.5-/"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="S3]#7/B!U_+Bxa1nb(b%"><field name="NUM">530</field></block></value><value name="ARG1"><block type="math_number" id="rF3#NSK58tmFK~j.Yy~F"><field name="NUM">300</field></block></value><next><block type="flow_delay" id=";vSkK=mY^YRWio|ii:eN"><value name="DELAY"><block type="math_number" id="0|1`wQ$tHJxBj/Z3}LkO"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="b~zTdd)G=lri0~[w7lgi"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="nC=(nFyKpN5Kh`g/95d9"><field name="NUM">530</field></block></value><value name="ARG1"><block type="math_number" id="nx0E~)j[%pJAIpDHT^ix"><field name="NUM">300</field></block></value><next><block type="flow_delay" id="gJ}Q6uuT*A]^{m.e*(Rk"><value name="DELAY"><block type="math_number" id="=Zz~m,Ws4uP7EzF;8wJI"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="LI_Fbd47=c;L25a]{%KS"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="%=Tr,i]1m494~_htJz6x"><field name="NUM">530</field></block></value><value name="ARG1"><block type="math_number" id="rZ!rCl4~Tkh?U4f!+cRw"><field name="NUM">300</field></block></value><next><block type="flow_delay" id="71Nl_6|]73Z@m0Jx|mYC"><value name="DELAY"><block type="math_number" id="@R)6]X@;j%e.$7_5,Q.p"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="gi6)3,7k*=+OBsaP_:y*"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="7TkO{#fF7({,;=+91)|g"><field name="NUM">530</field></block></value><value name="ARG1"><block type="math_number" id="]GA*7Hu[H]?HcK=A`//k"><field name="NUM">300</field></block></value><next><block type="flow_delay" id="q[3*aWoc1!zy(eu8L.,o"><value name="DELAY"><block type="math_number" id="6[RCWEv#%2D`*ne(o3m7"><field name="NUM">150</field></block></value><next><block type="procedures_callnoreturn" id="BG;X;3;0EDV0,AmEmMfH"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="math_number" id="R~D*$;gqpdpzCp3{[Vxe"><field name="NUM">600</field></block></value><value name="ARG1"><block type="math_number" id="+.2}KQty$|UK87:`}z*Z"><field name="NUM">1000</field></block></value><next><block type="flow_delay" id="rS~60k6EsR8Xqw;1`aLR"><value name="DELAY"><block type="math_number" id="31IYCx2A-]Gn[bv6k:vF"><field name="NUM">2000</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></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></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="]b6`j)Wsu~PY(U`b$:?;" x="-448" y="-462"><mutation><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><field name="NAME">Spiele Ton</field><statement name="STACK"><block type="flow_repeat" id="IRtD0^PnwwyOe5Kw-}3^"><value name="REPEATS"><block type="variables_get" id="bB$Qr%h`_.W:?#{8-BOa"><field name="VAR" id="2Fx/dUvZ(-R}A!jmOp[f" variabletype="">Dauer</field></block></value><statement name="DO"><block type="led_write_state" id="ZUQgF9:QAgrY#mp-RTtD"><value name="LED"><block type="led_pin" id="=Kg/,g|90`U+5LK8#kt1"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="vDH^y,t|bVtaiu1+-OK-"><field name="STATE">LOW</field></block></value><next><block type="flow_delay_micro" id="zrR#Ct+5BSTs^-!VSvP@"><value name="DELAY_MICRO"><block type="variables_get" id="s_Da.ktnm[MC2H@O(Ipu"><field name="VAR" id="[|eRHsX0nrHe=T2pki}x" variabletype="">Frequenz</field></block></value><next><block type="led_write_state" id="kr_LMw]TWU^00_Lq%jHE"><value name="LED"><block type="led_pin" id="VmP$q;e?@g_x4}h.5r-#"><field name="LED">LED2</field></block></value><value name="VALUE"><block type="basic_digital_state" id="40GU9-PGr`*2(djMU2$N"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="|p+L4L{JD{jasC4rZVO,"><value name="DELAY_MICRO"><block type="variables_get" id="WYm^[W#)1+rX0ehPdCse"><field name="VAR" id="[|eRHsX0nrHe=T2pki}x" variabletype="">Frequenz</field></block></value></block></next></block></next></block></next></block></statement></block></statement></block></xml>

3. Challenge

3.1. R2-D2 mit Zufallsgenerator

Programmiere den originalen "R2-D2" Sound, indem du mit dem Zufallsgenerator experimentierst. Welche Werte klingen am besten? By the way: der Arduino Zufallsgenerator hat so seine Eigenheiten und wird deshalb Pseudo-Zufallsgenerator genannt. Mehr erfährst du hier:

Sketch 4: Arduino Piezo Element als Buzzer programmieren. Einfacher Ton
Video Thumbnail
Piezo Element als Buzzer Sound "R2-D2".
Piezo Element als Buzzer Sound "R2-D2".
Video Thumbnail
Star Wars - R2D2 sounds
Arduino Piezo Element 1. Vorbereiten Das Piezzo Element kann als Sensor oder Aktor an dein Arduino angeschlossen werden. Du kannst damit einfache Sounds kreieren oder Vibrationen messen. Google Keyword Arduino piezo music Google Keyword Arduino piezo sensor Google Keyword Piezoelektrizität Um das Pi

3.2. Präzise Tonhöhen berechnen

Wer bei "Alli mini äntli" genau hinhört, merkt, dass die Intonationen alles andere als rein sind. Dies müsste nicht sein: mit der Definition der Pausenlängen könnte die genaue Tonfrequenz berechnet werden. Im vorliegenden Beispiel wurde das jedoch unterlassen.

Erstelle mit Hilfe des Blocks "Funktion" (Bild 3) eine perfekt gestimmte Tonleiter, um so leichter deine eigenen Melodien komponieren zu können!

Unter dem folgenden Link findest du eine Tabelle mit den genauen Frequenzen der Tonleiter:

Daraus geht hervor, dass z.B. der Ton A (die Tonhöhe einer Stimmgabel) mit 440 Hz schwingt, also 440x pro Sekunde. Um am Ausgang unseres Mikrocontrollers also 440 Elektroimpulse/Sekunde zu haben, muss folgende Rechnung gemacht werden:

  • 1'000'000μs / 440 = 2272μs

Das Ergebnis ist die erforderliche Pausenlänge zwischen 2 Stromimpulsen. Da wir zwei Pausen verwenden (eine nach dem Einschalten und ein zweite nach dem Ausschalten, teilen wir die 2272μs auf diese zwei Delays auf. Das gibt dann zwei Pausen à 1136μs... Teste es!

 

Dieses Sketch zeigt eine mögliche Umsetzung. Füge es direkt in den PGLU-Editor ein:

<xml xmlns="http://www.w3.org/1999/xhtml"><variables><variable type="" id="[|eRHsX0nrHe=T2pki}x">Frequenz</variable><variable type="" id="S|PJQN4+d,by}%/vgoOS">x</variable><variable type="" id="q1EK=P3Pr^S]*5l|v](N">Länge</variable><variable type="" id="2Fx/dUvZ(-R}A!jmOp[f">Dauer</variable><variable type="" id="(DA.P!.6NQQuww`8Kw.-">Ton A</variable><variable type="" id="pYh0s~DNz[Vwz=ORM4Mn">Zeitstempel</variable><variable type="" id="v2atsd@FR`],{(_t=rkA">Ton E</variable><variable type="" id="6#+@IZM*lc)}DS!B!Ced">Ton G</variable><variable type="" id="yMcli_R.;4u9^+FP%#4{">Ton F</variable><variable type="" id="0nUc,=ZahEd9C(H8TAV-">Ton C</variable><variable type="" id="3Iz~$-EQD/i_Zz]^/7Zl">Ton D</variable><variable type="" id="kYX,*!)G|cD,$(Mf!zuI">Ton H</variable><variable type="" id="FP85Cr88)d#CB=#2VB+m">Ton C2</variable></variables><block type="basic_comment" id="2NbRHu_mkrO6St=h%@]`" x="-1043" y="-857"><field name="COMMENT">Frequenzen berechnen gem. workshop.pglu.ch &gt; Aktor &gt; Piezo Element</field></block><block type="expert_setup" id="a@GYYFDt@qtO,z(]_CVr" x="-1039" y="-797"><statement name="CODE"><block type="variables_set" id="@Q5_|g(v3HXWt1TglZyL"><field name="VAR" id="0nUc,=ZahEd9C(H8TAV-" variabletype="">Ton C</field><value name="VALUE"><block type="math_number" id="gTMvuaQL4v-)[keQ!8~f"><field name="NUM">956</field></block></value><next><block type="variables_set" id="7.fA3IB2H[XRX?UHedfw"><field name="VAR" id="3Iz~$-EQD/i_Zz]^/7Zl" variabletype="">Ton D</field><value name="VALUE"><block type="math_number" id="R^F$0UmtWl/E~d!@5f81"><field name="NUM">851</field></block></value><next><block type="variables_set" id="InW%BLpA66v0Ut4hoq61"><field name="VAR" id="v2atsd@FR`],{(_t=rkA" variabletype="">Ton E</field><value name="VALUE"><block type="math_number" id="crP:NZ6dN*|,4~+$apSS"><field name="NUM">758</field></block></value><next><block type="variables_set" id="K^FcCfKjHu+/2c:%J*+m"><field name="VAR" id="yMcli_R.;4u9^+FP%#4{" variabletype="">Ton F</field><value name="VALUE"><block type="math_number" id="nMg1K{rpE,jI#EWa~Q=v"><field name="NUM">715</field></block></value><next><block type="variables_set" id="[dX/wu#ID6/q,y0O-|pc"><field name="VAR" id="6#+@IZM*lc)}DS!B!Ced" variabletype="">Ton G</field><value name="VALUE"><block type="math_number" id=";TIWw2c0Tyq.=R|iM-IJ"><field name="NUM">638</field></block></value><next><block type="variables_set" id="co3uCJ78H0urSz*8]3t_"><field name="VAR" id="(DA.P!.6NQQuww`8Kw.-" variabletype="">Ton A</field><value name="VALUE"><block type="math_number" id="tgWA@:*G)Fn)0ev|$!]B"><field name="NUM">568</field></block></value><next><block type="variables_set" id="gcM8l`U?VwfOwd-LEIr!"><field name="VAR" id="kYX,*!)G|cD,$(Mf!zuI" variabletype="">Ton H</field><value name="VALUE"><block type="math_number" id="~`[,yO)aV(Qv9#y5g~,0"><field name="NUM">506</field></block></value><next><block type="variables_set" id="^U:BpIKCt(jjdisaqi#}"><field name="VAR" id="FP85Cr88)d#CB=#2VB+m" variabletype="">Ton C2</field><value name="VALUE"><block type="math_number" id="bA-x4wDZIFB}{nGMSQ`H"><field name="NUM">478</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="basic_main_loop" id="}Uv^ljo8%{bpam,]`pv9" deletable="false" x="-1039" y="-499"><value name="BLINK"><block type="basic_blinkcode" id="KI3qY)zZZS)^g@+zo-ba"><field name="SHORT">1</field><field name="LONG">1</field></block></value><statement name="CODE"><block type="procedures_callnoreturn" id="?}.bj!FCJnuY2Gqa%X7%"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="xk;!?uxCRpw]*qaY=[*R"><field name="VAR" id="0nUc,=ZahEd9C(H8TAV-" variabletype="">Ton C</field></block></value><value name="ARG1"><block type="math_number" id="+h0J0QZ21%l|u.~s}LY_"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="$qLIYO=[4[bB{[n[K_)r"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="b[]m%{sIUUB1;51]Up:P"><field name="VAR" id="3Iz~$-EQD/i_Zz]^/7Zl" variabletype="">Ton D</field></block></value><value name="ARG1"><block type="math_number" id="d2IAe+WV.Qk=RJ.-[%nb"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="qkp01~-z+lZkL=S-q^mf"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="[9{!uT$}s^,BULv4UGA*"><field name="VAR" id="v2atsd@FR`],{(_t=rkA" variabletype="">Ton E</field></block></value><value name="ARG1"><block type="math_number" id="B%H*qF)^#$atnzb@r$f."><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="lUK,cOFggc.#wS.Se*US"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="c(;50g`ADxeCOKXx(;e="><field name="VAR" id="yMcli_R.;4u9^+FP%#4{" variabletype="">Ton F</field></block></value><value name="ARG1"><block type="math_number" id="~x}Q-;[ER|i[Cq_svsqW"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="E7c2RQ/~mU53+`/;s43*"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="Uz1fFKfE~Zn$3@l7;zU5"><field name="VAR" id="6#+@IZM*lc)}DS!B!Ced" variabletype="">Ton G</field></block></value><value name="ARG1"><block type="math_number" id="iYB?o[RY|7Zwgy}X-P#b"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="Q(fC`TDUUSKqj6m1:BQB"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="([:9m,1{Mp6oOA!`9hm_"><field name="VAR" id="(DA.P!.6NQQuww`8Kw.-" variabletype="">Ton A</field></block></value><value name="ARG1"><block type="math_number" id="j7!.=Uqbk.CNyoiEur+T"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id=".NM/Rv701LL98+Q/TT4_"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="w:AR9MIxQEm;sLE!h/bC"><field name="VAR" id="kYX,*!)G|cD,$(Mf!zuI" variabletype="">Ton H</field></block></value><value name="ARG1"><block type="math_number" id="nEe5#/{M5v^3bh3B#v4H"><field name="NUM">1000</field></block></value><next><block type="procedures_callnoreturn" id="m)lomjhrn4.eKA3I*7_q"><mutation name="Spiele Ton"><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><value name="ARG0"><block type="variables_get" id="nAb#36Muaw#O}NLLqPCd"><field name="VAR" id="FP85Cr88)d#CB=#2VB+m" variabletype="">Ton C2</field></block></value><value name="ARG1"><block type="math_number" id="aPU{cgoP}z?z6dz+0i7m"><field name="NUM">1000</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="]b6`j)Wsu~PY(U`b$:?;" x="-535" y="-500"><mutation><arg name="Frequenz"></arg><arg name="Dauer"></arg></mutation><field name="NAME">Spiele Ton</field><statement name="STACK"><block type="variables_set" id="2~^x4T*ClY)P%WIiq)}q"><field name="VAR" id="pYh0s~DNz[Vwz=ORM4Mn" variabletype="">Zeitstempel</field><value name="VALUE"><block type="flow_ms" id=")pK1279F4k@M*|R})B4j"></block></value><next><block type="flow_until" id="xcPr=%yu%hWC_B.7To^]"><value name="CONDITION"><block type="logic_compare" id="d9hWeEfn1$nj$w0XaGDt"><field name="OP">GT</field><value name="A"><block type="math_arithmetic" id="t1-Km2K0=wG!//uurQ|3"><field name="OP">MINUS</field><value name="A"><block type="flow_ms" id="YKkOV7iiZqPprta1ScO("></block></value><value name="B"><block type="variables_get" id="_/]H./Gc3:$Z-^o0Hy(_"><field name="VAR" id="pYh0s~DNz[Vwz=ORM4Mn" variabletype="">Zeitstempel</field></block></value></block></value><value name="B"><block type="variables_get" id="D[?=Z7d?~W+JO(%GCLRC"><field name="VAR" id="2Fx/dUvZ(-R}A!jmOp[f" variabletype="">Dauer</field></block></value></block></value><statement name="DO"><block type="led_write_state" id="ZUQgF9:QAgrY#mp-RTtD"><value name="LED"><block type="led_pin" id="=Kg/,g|90`U+5LK8#kt1"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="vDH^y,t|bVtaiu1+-OK-"><field name="STATE">LOW</field></block></value><next><block type="flow_delay_micro" id="zrR#Ct+5BSTs^-!VSvP@"><value name="DELAY_MICRO"><block type="variables_get" id="s_Da.ktnm[MC2H@O(Ipu"><field name="VAR" id="[|eRHsX0nrHe=T2pki}x" variabletype="">Frequenz</field></block></value><next><block type="led_write_state" id="kr_LMw]TWU^00_Lq%jHE"><value name="LED"><block type="led_pin" id="VmP$q;e?@g_x4}h.5r-#"><field name="LED">LED1</field></block></value><value name="VALUE"><block type="basic_digital_state" id="40GU9-PGr`*2(djMU2$N"><field name="STATE">HIGH</field></block></value><next><block type="flow_delay_micro" id="|p+L4L{JD{jasC4rZVO,"><value name="DELAY_MICRO"><block type="variables_get" id="WYm^[W#)1+rX0ehPdCse"><field name="VAR" id="[|eRHsX0nrHe=T2pki}x" variabletype="">Frequenz</field></block></value></block></next></block></next></block></next></block></statement></block></next></block></statement></block></xml>

Video Thumbnail
Arduino project buzzer & LED
Arduino Piezo Element 1. Vorbereiten Das Piezzo Element kann als Sensor oder Aktor an dein Arduino angeschlossen werden. Du kannst damit einfache Sounds kreieren oder Vibrationen messen. Google Keyword Arduino piezo music Google Keyword Arduino piezo sensor Google Keyword Piezoelektrizität Um das Pi

Frage etwas oder gib uns dein Feedback