4180 final project

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
srikard
Date:
Wed Dec 10 05:21:09 2014 +0000
Commit message:
EasyVR test

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 10 05:21:09 2014 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+ 
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+Serial device(p13, p14);  // tx, rx
+Serial pc(USBTX, USBRX); 
+Serial rn41(p9,p10);
+ 
+int main() {
+    rn41.baud(19200);
+    char rchar=0;
+//wake up device - needs more work and a timeout
+    device.putc('b');
+    while (device.getc()!='o') {
+        device.putc('b');
+        led1 = 1;
+        wait(0.2);
+    }
+    led2=1;
+    while (1) {
+        device.putc('i'); //Start Recognition
+        device.putc('D'); //Use Group 1 
+//Use built-in speaker independent numbers (0..10) and listen for a number
+        while (device.readable()!=0 && rn41.readable()) {}
+        //rchar = device.getc();
+        //pc.putc(rchar);
+        if (device.getc()=='s') {
+            device.putc(' ');
+            rchar = device.getc();
+            //pc.putc(rchar);
+            //rchar=device.getc();
+            if (rchar=='B') led1=!led1;
+            if (rchar=='C') led2=!led2;
+            if (rchar=='D') led3=!led3;
+            if (rchar=='E') led4=!led4;
+            rn41.putc(rchar);
+            
+        }
+        /*if(rn41.getc() == 'a')
+        {
+            led3 = !led3; 
+        }*/
+    
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Dec 10 05:21:09 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file