Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:67daefa90d5c, committed 2018-03-03
- Comitter:
- kenjiArai
- Date:
- Sat Mar 03 02:02:57 2018 +0000
- Commit message:
- Checking program for Piezo_Buzzer (Interrupt driven piezo buzzer control library)
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Piezo_Buzzer.lib Sat Mar 03 02:02:57 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/kenjiArai/code/Piezo_Buzzer/#5cf10634ae7b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Mar 03 02:02:57 2018 +0000 @@ -0,0 +1,45 @@ +/* + * Mbed Application program + * check Piezo Buzzer function + * + * Copyright (c) 2018 Kenji Arai / JH1PJL + * http://www.page.sannet.ne.jp/kenjia/index.html + * http://mbed.org/users/kenjiArai/ + * Modify: Feburary 28th, 2018 + * Revised: March 3rd, 2018 + */ + +// Include -------------------------------------------------------------------- +#include "mbed.h" +#include "piezo_bz.h" + +// Definition ----------------------------------------------------------------- + +// Object --------------------------------------------------------------------- +Serial pc(USBTX, USBRX); +//PIEZO_BZ bz(D8, 500, 500); +PIEZO_BZ bz(D8, 500, CONTINUOUS_MODE); // 500Hz Continuous Mode + +// RAM ------------------------------------------------------------------------ + +// ROM / Constant data -------------------------------------------------------- + +// Function prototypes -------------------------------------------------------- + +//------------------------------------------------------------------------------ +// Control Program +//------------------------------------------------------------------------------ +int main() +{ + while (true) { + for (uint32_t i = 1; i < 110; i++) { + uint32_t freq = (500 * i) /10; + bz.start(); + wait(2.0f); + bz.stop(); + wait(0.1f); + bz.change_frequency(freq); + pc.printf("Freq= %4d [Hz]\r\n", freq); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Sat Mar 03 02:02:57 2018 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#91e6db1ea251ffcc973001ed90477f42fdca5751