Änderungen

Aus Linkerkit.de

Wechseln zu: Navigation, Suche

LK-Buzzer

335 Byte hinzugefügt, 17:05, 9. Nov. 2016
/* Codebeispiel für Raspberry */
</div>
==Codebeispiel Arduino==
<pre class="codebrush:cpp">int speakerPin = 9;
int length = 15; // Anzahl der Noten
char notes[] = "ccggaagffeeddc ";
delay(tempo / 2);
}
} </pre> 
==Codebeispiel für Raspberry==
 <pre class="brush:py"> import RPi.GPIO as GPIOfrom time import sleep buz = 15GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)GPIO.setup(buz, GPIO.OUT) #Die Tonhoehe kann mit Variation der Wartezeit (sleep) veraendert werdenwhile True: GPIO.output(buz, True) sleep(0.0005) GPIO.output(buz, False) sleep(0.0005) </pre>
==Download==