A short test program for all things m3pi and BtBee.

Dependencies:   btbee m3pi_ng mbed

Fork of m3pi_btTest by Nikolas Goldin

Revision:
6:19373be8bfe9
Parent:
5:2e5fd80518c5
--- a/main.cpp	Wed May 22 11:42:09 2013 +0000
+++ b/main.cpp	Thu May 15 08:46:40 2014 +0000
@@ -11,6 +11,8 @@
 
 Timer t1;
 
+//LocalFileSystem local("local");    
+
 int main()
 {
     // initialization stuff ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -40,6 +42,23 @@
     //m3pi.playtune(dixie,len);
     m3pi.locate(0,0);
     m3pi.printf("B:%0.3f%V",m3pi.battery());
+    wait(0.3);
+    
+/*    m3pi.locate(0,0);
+    m3pi.printf("%s","fileTest");
+
+    FILE *fp = fopen("/local/out.txt", "w");  // Open "out.txt" on the local file system for writing
+    fprintf(fp, "Hello World!");
+    fclose(fp);
+
+    m3pi.locate(0,1);
+    m3pi.printf("%s","doneTest");
+    
+*/    
+    m3pi.locate(0,0);
+    m3pi.printf("%s","btTest");
+    m3pi.locate(0,1);
+    m3pi.printf("%s","PBonLNK");
 
     // wait for the user to push P21, should be pressed when the bt link is established (green led "link")
     while(m3pi_pb) {
@@ -59,13 +78,16 @@
             if (iline==6) {
                 btbee.printf("end\n");
                 write=1;
+                iline=7;
             }//if
             else {
+                if (iline <6){
                 btbee.printf("Line %0.3d \n",iline);
                 m3pi_led[0]=0;
                 m3pi.locate(0,0);
                 m3pi.printf("Sent %0.3d",iline);
                 iline++;
+                }
             }//else
         }//if_write