It's not my library, i just want to publish my program.

Fork of PWM_Tone_Library by justin kim

Revision:
3:b3ee09f3ff8f
Parent:
2:dd4ed6c28c87
--- a/pwm_tone.cpp	Tue Dec 13 16:21:19 2016 +0000
+++ b/pwm_tone.cpp	Fri Mar 31 14:51:06 2017 +0000
@@ -20,9 +20,11 @@
     
     delay = beat*63;
     name.period_us(period);
-    name.write(1.0f); // 50% duty cycle
+    name.write(0.50f); // 50% duty cycle
     wait_ms(delay); // 1 beat
     name.period_us(0); // Sound off
+    name.write(0.00f); // 50% duty cycle
+    name.period_us(0); // Sound off
 }
 
 /**
@@ -38,7 +40,7 @@
     
     delay = beat*63;
     name.period_us(period);
-    name.write(1.0f); // 50% duty cycle
+    name.write(0.50f); // 50% duty cycle
     wait_ms(delay);
 }