Alan Simms / Mbed 2 deprecated threeAxisTable

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

Files at this revision

API Documentation at this revision

Comitter:
magiwarriorx
Date:
Thu Dec 16 10:52:44 2021 +0000
Parent:
14:d6c8724a69e8
Commit message:
Initial public commit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
threeAxis.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Dec 15 02:10:57 2021 +0000
+++ b/main.cpp	Thu Dec 16 10:52:44 2021 +0000
@@ -104,6 +104,9 @@
         Thread::wait(100);
         
         if (bluetooth.readable()){
+            LCD.lock();
+            uLCD.cls();
+            LCD.unlock();
             while (bluetooth.readable()){
                 
                 char temp = bluetooth.getc();
@@ -114,14 +117,16 @@
                 else if(temp == 'b'){
                     buffering = !buffering;
                 }
+                else if(temp == 'e'){
+                    table.setLimits(!table.getLimitsEn());
+                }
                 
-                    coords += temp;
+                coords += temp;
             }
         
             //Thread::wait(1000);
         LCD.lock();
-        uLCD.printf("\n");
-        if ((coords.find('z') == -1) && (coords.find('b') == -1)){                
+        if ((coords.find('z') == -1) && (coords.find('b') == -1) && (coords.find('e') == -1)){                
              uLCD.printf(coords.c_str());
              LCD.unlock();
              parseCoords(coords);
@@ -139,7 +144,18 @@
                      LCD.unlock();
                  }
                  else if (!buffering){
-                     uLCD.printf("Time to run buffer!");
+                     uLCD.printf("Running buffer!");
+                     LCD.unlock();
+                     table.runBuffer();
+                 }
+             }
+             else if (coords.find('e') != -1){
+                 if (table.getLimitsEn()){
+                     uLCD.printf("Limits enabled!");
+                     LCD.unlock();
+                 }
+                 else if (!table.getLimitsEn()){
+                     uLCD.printf("Limits disabled!");
                      LCD.unlock();
                      table.runBuffer();
                  }
@@ -177,7 +193,7 @@
     }
     //LCD.lock();
     uLCD.printf("\n");
-    uLCD.printf("Enter anything to stop");
+    uLCD.printf("Enter null to stop");
     LCD.unlock();
     
     thread2.start(raiseLimit,&xLimit);
@@ -198,7 +214,7 @@
     
     LCD.lock();
     uLCD.printf("\n");
-    uLCD.printf("Enter anything to stop");
+    uLCD.printf("Enter null to stop");
     LCD.unlock();
     
     thread2.start(raiseLimit,&yLimit);
@@ -219,7 +235,7 @@
     
     LCD.lock();
     uLCD.printf("\n");
-    uLCD.printf("Enter anything to stop");
+    uLCD.printf("Enter null to stop");
     LCD.unlock();
     
     
--- a/threeAxis.lib	Wed Dec 15 02:10:57 2021 +0000
+++ b/threeAxis.lib	Thu Dec 16 10:52:44 2021 +0000
@@ -1,1 +1,1 @@
-threeAxis#5206484275e3
+https://os.mbed.com/users/magiwarriorx/code/threeAxis/#09abcf461dc2