A short test program for all things m3pi and BtBee.

Dependencies:   btbee m3pi_ng mbed

Fork of m3pi_btTest by Nikolas Goldin

Files at this revision

API Documentation at this revision

Comitter:
ngoldin
Date:
Thu May 15 08:46:40 2014 +0000
Parent:
5:2e5fd80518c5
Commit message:
dont know when last commit was. for safety.

Changed in this revision

btbee.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
diff -r 2e5fd80518c5 -r 19373be8bfe9 btbee.lib
--- a/btbee.lib	Wed May 22 11:42:09 2013 +0000
+++ b/btbee.lib	Thu May 15 08:46:40 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ngoldin/code/btbee/#12c38a710982
+http://mbed.org/users/ngoldin/code/btbee/#3cdbefbd2409
diff -r 2e5fd80518c5 -r 19373be8bfe9 main.cpp
--- 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