Bluetooth Enabled Keyboard/Synthesizer for mbed

Dependencies:   mbed 4DGL-uLCD-SE SDFileSystem mbed-rtos

Revision:
19:2f635d03467c
Parent:
18:24f56dcc5a59
Child:
20:f3e994db66be
Child:
21:0df25c61c475
--- a/main.cpp	Fri Apr 29 22:59:39 2016 +0000
+++ b/main.cpp	Fri Apr 29 23:26:49 2016 +0000
@@ -411,7 +411,7 @@
 
 void generate_squareWave(int frequency)     // Generates samples for a square wave of a given input frequency. Looks at whether we have seen an even or odd number of 'widths' to determine if wave should be high or low at given t
 {
-    double width = (1 / 2 * frequency);     // Width of a half period of the square wave
+    double width = (1 / (2 * frequency));     // Width of a half period of the square wave
     double t = 0;                           // Represents time, since we want a 2 second note with 256 samples
     for(int i = 0; i < 256; i++)
     {
@@ -462,8 +462,8 @@
 {
     for( int sample = 0; sample < 256; sample++)
     {
-        synthPin = sampleBuffer[sample];
-        Thread::wait(timeIncrement * 1000);
+        //synthPin = sampleBuffer[sample];
+        PC.printf("Current Sample: %f",sampleBuffer[sample]);
     }
     clear_Buffer();
 }