final design project

Dependencies:   SDFileSystem TextLCD mbed wave_player

Files at this revision

API Documentation at this revision

Comitter:
lenhardt
Date:
Thu Nov 20 22:36:06 2014 +0000
Commit message:
guccimaynepradamayneversace

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.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.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
diff -r 000000000000 -r 462dcb4093f2 SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Thu Nov 20 22:36:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/SDFileSystem/#c8f66dc765d4
diff -r 000000000000 -r 462dcb4093f2 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu Nov 20 22:36:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
diff -r 000000000000 -r 462dcb4093f2 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 20 22:36:06 2014 +0000
@@ -0,0 +1,67 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+#include "wave_player.h"
+
+SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card
+
+Ticker tick;
+
+AnalogIn fsr(p15);
+PwmOut led(p26);
+Serial term(USBTX, USBRX);
+AnalogOut DACout(p18);
+
+wave_player waver(&DACout);
+FILE *wave_file;
+
+void playthisbitch() {
+    //FILE *wave_file;
+    //wave_file=fopen("/sd/sample.wav","r");
+    //waver.play(wave_file);
+}
+
+int main() {
+    //FILE *wave_file;
+    //wave_file=fopen("/sd/sample.wav","r");
+    //waver.play(wave_file);
+
+    
+    float reading;
+    while (1){
+            reading = (float)fsr;
+            term.printf("\nReading is: %f\r", (float)fsr);
+            led = 0.0f;
+                led = (float)fsr;
+                wait(.1);
+            if( (float)fsr > .02){
+                //tick.detach();
+                //tick.attach(&playthisbitch, 500000);
+                //tick.detach();
+                wave_file=fopen("/sd/sample.wav","r");
+                waver.play(wave_file);
+                }
+                wait_us(500);
+        }
+        
+        fclose(wave_file);
+}
+/*
+#include "mbed.h" 
+#include "SDFileSystem.h"
+#include "wave_player.h"
+
+
+SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card
+
+AnalogOut DACout(p18);
+
+wave_player waver(&DACout);
+
+int main()
+{
+    FILE *wave_file;
+    printf("\n\n\nHello, wave world!\n");
+    wave_file=fopen("/sd/sample.wav","r");
+    waver.play(wave_file);
+    fclose(wave_file);
+}*/
\ No newline at end of file
diff -r 000000000000 -r 462dcb4093f2 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 20 22:36:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file
diff -r 000000000000 -r 462dcb4093f2 wave_player.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wave_player.lib	Thu Nov 20 22:36:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/YongChingTee/code/wave_player/#73343f43feb1