First commit. Hello World program for non_blocking_Led_Buzzer library

Dependencies:   non_blocking_Led_Buzzer

Files at this revision

API Documentation at this revision

Comitter:
tsungta
Date:
Mon Nov 21 06:43:50 2016 +0000
Commit message:
Hello World program for non_blocking_Led_Buzzer library

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
non_blocking_Led_Buzzer.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 21 06:43:50 2016 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "Buzzer.h"
+#include "Led.h"
+
+Buzzer buzzer(A1);
+DigitalOut led1(LED2);
+Led led(LED3);
+
+#define tone_num   5
+#define schedule_num   7
+float tone[tone_num] = {262, 294, 330, 349, 392};
+uint8_t toggle[schedule_num] = {1,1,1,0,1,0,1};
+
+
+
+// main() runs in its own thread in the OS
+// (note the calls to Thread::wait below for delays)
+int main() {
+
+    buzzer.playMelody(tone, tone_num, 0.5);
+    led.toggleLed(toggle, schedule_num, 0.5);
+
+    while (true) {
+        led1 = !led1;
+        wait(2);
+        led.simpleBlink(1);
+        printf("hello\r\n");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Nov 21 06:43:50 2016 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#a1c0840b3d69060e5eb708edb18358e424a40f51
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/non_blocking_Led_Buzzer.lib	Mon Nov 21 06:43:50 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/Delta/code/non_blocking_Led_Buzzer/#c18c119011ec