Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed threeAxis mbed-rtos 4DGL-uLCD-SE
Diff: main.cpp
- Revision:
- 15:dee1c2f0e82f
- Parent:
- 14:d6c8724a69e8
diff -r d6c8724a69e8 -r dee1c2f0e82f main.cpp
--- 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();