final design project

Dependencies:   SDFileSystem TextLCD mbed wave_player

Revision:
0:462dcb4093f2
--- /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