Leong Kum Loong (NYP) / tone_h

Dependents:   Tone_Example

Committer:
reesey
Date:
Mon Nov 20 03:53:48 2017 +0000
Revision:
3:9ddabd24f48c
Parent:
1:3b00679c208a
tone.h; Written by Leong Kum Loong.; 20 Nov 2017, REV. 2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
reesey 0:2b4c66b3f6aa 1 /*
reesey 0:2b4c66b3f6aa 2 tone.h
reesey 0:2b4c66b3f6aa 3 Written by Leong Kum Loong.
reesey 3:9ddabd24f48c 4 20 Nov 2017, REV. 2
reesey 0:2b4c66b3f6aa 5
reesey 0:2b4c66b3f6aa 6 All routines and functions in this library are written by me solely with the purpose
reesey 0:2b4c66b3f6aa 7 of implementing an identical "tone" library that was introduced by Arduino IDE.
reesey 1:3b00679c208a 8
reesey 1:3b00679c208a 9 Example reference from Github
reesey 1:3b00679c208a 10 ===============================
reesey 1:3b00679c208a 11 The mario_example routine "notes" are reference to the work of Gregory Kielian.
reesey 1:3b00679c208a 12 The starwars_example routine "notes" are reference to the work of nicksort.
reesey 0:2b4c66b3f6aa 13 */
reesey 0:2b4c66b3f6aa 14
reesey 0:2b4c66b3f6aa 15 #ifndef tone_h
reesey 0:2b4c66b3f6aa 16 #define tone_h
reesey 0:2b4c66b3f6aa 17 #include "mbed.h"
reesey 0:2b4c66b3f6aa 18
reesey 3:9ddabd24f48c 19 void tone(int frequency, int duration_ms=0); //Sound tone at specific frequency of 50% duty cycle and duration(optional).
reesey 3:9ddabd24f48c 20
reesey 3:9ddabd24f48c 21 void noTone(); //Turn off tone.
reesey 0:2b4c66b3f6aa 22
reesey 0:2b4c66b3f6aa 23 void mario_example();
reesey 0:2b4c66b3f6aa 24
reesey 1:3b00679c208a 25 void starwars_example();
reesey 1:3b00679c208a 26
reesey 0:2b4c66b3f6aa 27 #endif