Step1)無源蜂鳴器的接線
無源蜂鳴器(背面可以看到綠色電路)正極(長腳)接pin 12,負極接地(GND)。
Step2)使用Python透過Raspberry讓蜂鳴器發出聲音,將以下程式儲存成檔案sound.py。
實驗圖片
執行影片
參考資料
http://tangblack.blogspot.tw/2015/02/raspberry-pi-b.html
https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/