このライブラリでは、単音とメロディの出力が可能です。 In this library, you can output a single tone and melody. mbedのpwmOutとDigitalOutを使ってスピーカや圧電ブザーを直接駆動します。 directly drive speaker or buzzer and DigitalOut pwmOut using the mbed. メロディデータは、mbedのローカルにtxtファイルとして保存するか、プログラム中に配列データとして保存してください。 Melody data is either stored in a txt file on the local mbed, save it as a data array in the program.

Dependents:   kitchenTimer_Clock SoundLibraryExample_Melody_ProgramData M3PI_SuiviLigne

Files at this revision

API Documentation at this revision

Comitter:
suupen
Date:
Sun Dec 11 11:20:31 2011 +0000
Parent:
8:71488a68dc58
Child:
10:059d4df77110
Commit message:
V1.1 2011/12/11 muonji no bug fix

Changed in this revision

Sound.cpp Show annotated file Show diff for this revision Revisions of this file
Sound.h Show annotated file Show diff for this revision Revisions of this file
--- a/Sound.cpp	Sat Nov 19 08:18:24 2011 +0000
+++ b/Sound.cpp	Sun Dec 11 11:20:31 2011 +0000
@@ -100,15 +100,19 @@
             O_sound.envelope -= Z_pulseCheckSyuuki;
         } else {
             O_sound.envelope = 0;
+            sound_out(0.0, 0);
         }
     }
     else{
+    sound_out(0.0, 0);
+/*    
     // O_sound.syuuki == 0 then sound nasi
     
-        if(f_muonSet == 0){
-            f_muonSet = 1;
-            sound_out(0.0, 0);      // 5us
+        if(f_muonSet == 1){
+            f_muonSet = 0;
+            sound_out(0.0, 0);
         }
+*/
     }
     
     //*************************************************
--- a/Sound.h	Sat Nov 19 08:18:24 2011 +0000
+++ b/Sound.h	Sun Dec 11 11:20:31 2011 +0000
@@ -26,6 +26,7 @@
 /*                                                                     */
 /*    V0.1 : 2011/11/13                                                */
 /*    V0.2 : 2011/11/19  Added copyright notice                        */ 
+/*    V1.1 : 2011/12/11 muon ji no syori bug fix                       */
 /***********************************************************************/
 #ifndef _SOUND_H
 #define _SOUND_H