Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL2

Dependencies:   mbed

Revision:
1:9f8583ba2431
Child:
3:d8948c5b2951
diff -r 44a3005d4f20 -r 9f8583ba2431 src/menu.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/menu.cpp	Sun Nov 25 00:36:35 2018 +0000
@@ -0,0 +1,52 @@
+//-------------------------------------------------------------------------------
+// 
+//  Treehouse Inc.
+//  Colorado Springs, Colorado
+// 
+//  Copyright (c) 2016 by Treehouse Designs Inc. 
+// 
+//  This code is the property of Treehouse, Inc. (Treehouse) and may not be redistributed
+//  in any form without prior written permission from the copyright holder, Treehouse.
+//
+//  The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+//   
+//-------------------------------------------------------------------------------
+// 
+//  REVISION HISTORY:
+//  
+//   $Author: $
+//   $Rev: $
+//   $Date: $
+//   $URL: $
+// 
+//-------------------------------------------------------------------------------
+
+#include "mbed.h"
+#include "serial.h"
+#include "menu.h"
+
+// clears terminal
+void clrScrn(void){
+    sprintf( strbuf, "%c[2J", 27 ); // ESC=27, Clear screen = [2J
+    sendSerial(strbuf);
+    sprintf( strbuf, "%c[f", 27 ); // ESC=27, Move cursor to upper-left corner = [f
+    sendSerial(strbuf);
+}
+
+// clears terminal and re-draws main menu
+void menuRedraw(void){
+    clrScrn();
+    sprintf(strbuf, "Agility Power Systems DCM1 Menu 0.1");
+    sendSerial(strbuf);
+    sprintf(strbuf, "\r\nMULT");
+    sendSerial(strbuf);
+    sprintf(strbuf, "\r\nBRDS");
+    sendSerial(strbuf);
+    sprintf(strbuf, "\r\nALLOFF");
+    sendSerial(strbuf);
+    sprintf(strbuf, "\r\nRUN [xx]");
+    sendSerial(strbuf);
+    sprintf(strbuf, "\r\nSTOP");
+    sendSerial(strbuf);
+}
\ No newline at end of file