PWM出力によって圧電スピーカーで容易に音を鳴らすことができるライブラリです。

Dependents:   kiokuryoku_game escapeFromYou junirobo_sample001 ROBOX_Sample_IRcon ... more

Files at this revision

API Documentation at this revision

Comitter:
RBH
Date:
Thu Feb 23 12:44:55 2017 +0000
Parent:
12:f2b80b003d6d
Commit message:
boot???

Changed in this revision

beep_sound.cpp Show annotated file Show diff for this revision Revisions of this file
beep_sound.h Show annotated file Show diff for this revision Revisions of this file
--- a/beep_sound.cpp	Sun Oct 09 06:19:31 2016 +0000
+++ b/beep_sound.cpp	Thu Feb 23 12:44:55 2017 +0000
@@ -136,6 +136,21 @@
 
 //以下サンプル音集
 //引数の回数だけ鳴らす
+void beep_sound::boot()
+{
+    beep_sound::setGakuhu(2,0,0.08);
+    beep_sound::setKyuhu(0.07);
+    beep_sound::setGakuhu(2,2,0.08);
+    beep_sound::setKyuhu(0.07);
+    beep_sound::setGakuhu(2,5,0.08);
+    beep_sound::setKyuhu(0.07);
+    beep_sound::setGakuhu(2,7,0.1);
+    beep_sound::setGakuhu(2,9,0.1);
+    beep_sound::setGakuhu(2,11,0.1);
+    beep_sound::setGakuhu(3,0,0.4);
+    beep_sound::playGakuhu();
+}
+
 void beep_sound::beep_right(int nTimes)
 {
     for(int i=0; i<nTimes; i++){
--- a/beep_sound.h	Sun Oct 09 06:19:31 2016 +0000
+++ b/beep_sound.h	Thu Feb 23 12:44:55 2017 +0000
@@ -29,6 +29,7 @@
         void sinwave(float center,int speed,int width);
         void setwave(float frequency,float duty,float wait);
         // 以下サンプル音集
+        void boot();
         void beep_right(int nTimes);
         void beep_wrong(int nTimes);
         void beep_1up(int nTimes);