init

Dependencies:   SDFileSystem mbed-rtos mbed wave_player

Files at this revision

API Documentation at this revision

Comitter:
emanuel22e
Date:
Fri Oct 14 19:33:05 2022 +0000
Child:
1:4fd1a4e54648
Commit message:
init

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
wave_player.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Fri Oct 14 19:33:05 2022 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/SDFileSystem/#8db0d3b02cec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 14 19:33:05 2022 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+#include "rtos.h"
+#include "wave_player.h"
+#include "SDFileSystem.h"
+SDFileSystem sd(p5, p6, p7, p8, "sd");
+PwmOut red(p21);
+PwmOut green(p22);
+PwmOut blue(p23);
+AnalogOut speaker(p18);
+wave_player waver(&speaker);
+Thread thread1;
+Thread thread2;
+void t1() {
+    red = 0;
+    green = 0;
+    blue = 0;
+    while (1) {
+        red = 1;
+        green = 0;
+        blue = 0;
+        Thread::wait(300);
+        red = 0;
+        green = 1;
+        blue = 0;
+        Thread::wait(300);
+        red = 0;
+        green = 0;
+        blue = 1;
+        Thread::wait(300);
+        
+    }
+void t2() {
+    FILE *wave_file;
+    //open wav file and play it
+    wave_file=fopen("/sd/thread_sound.wav","r");
+    waver.play(wave_file);
+    fclose(wave_file);
+    //end of program
+    Thread::wait(500);
+}
+
+int main() {
+    thread1.start(t1);
+    thread2.start(t2);
+    while(1) {
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Oct 14 19:33:05 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed-rtos/#5713cbbdb706
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Oct 14 19:33:05 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wave_player.lib	Fri Oct 14 19:33:05 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/sravet/code/wave_player/#acc3e18e77ad