[chronojump/michrolab] Menus in separate file menus.ino



commit dc60c656669f2eaf31c31b296242a8171fe4b9bc
Author: Xavier Padullés <testing chronojump org>
Date:   Wed May 25 11:24:18 2022 +0200

    Menus in separate file menus.ino

 arduino/michrolab/michrolab.ino | 59 +----------------------------------------
 1 file changed, 1 insertion(+), 58 deletions(-)
---
diff --git a/arduino/michrolab/michrolab.ino b/arduino/michrolab/michrolab.ino
index 6cdca5a1e..a29f2e0d0 100644
--- a/arduino/michrolab/michrolab.ino
+++ b/arduino/michrolab/michrolab.ino
@@ -23,7 +23,7 @@
 
 */
 
-#include <EEPROM.h>
+#include "EEPROM.h"
 #include "SPI.h"
 #include "ILI9341_t3.h"
 #include "HX711.h"
@@ -393,22 +393,6 @@ void loop()
   if (Serial.available()) serialEvent();
 }
 
-void showMenuEntry(unsigned int currentMenuIndex)
-{
-  tft.fillRect(30, 0, 260, 50, BLACK);
-  tft.setCursor(40, 20);
-  tft.setTextSize(3);
-  tft.print(currentMenu[currentMenuIndex].title);
-
-  tft.setTextSize(2);
-  tft.setCursor(12, 100);
-  tft.setTextColor(BLACK);
-  tft.print(currentMenu[(currentMenuIndex + menuItemsNum - 1) % menuItemsNum].description);
-  tft.setTextColor(WHITE);
-  tft.setCursor(12, 100);
-  tft.print(currentMenu[currentMenuIndex].description);
-}
-
 void getLoadCellDynamics(void)
 {
   measured = scale.get_units();
@@ -998,20 +982,6 @@ void showLoadCellResults() {
   drawMenuBackground();
 }
 
-void showSystemMenu(void)
-{
-  drawMenuBackground();
-  currentMenuIndex = 0;
-  for (int i = 0; i< 10; i++){
-    currentMenu[i].title = systemMenu[i].title;
-    currentMenu[i].description = systemMenu[i].description;
-    currentMenu[i].function = systemMenu[i].function;
-  }
-  menuItemsNum = 5;
-  showMenuEntry(currentMenuIndex);
-  //showMenu();
-}
-
 void startSteadiness(void)
 {
   sensor = loadCell;
@@ -1159,14 +1129,6 @@ void redrawAxes(ILI9341_t3 & d, double gx, double gy, double w, double h, double
   }
 }
 
-void drawMenuBackground() {
-  tft.fillScreen(BLACK);
-  tft.fillRoundRect(0, 0, 30, 50, 10, WHITE);
-  tft.fillRoundRect(290, 0, 30, 50, 10, WHITE);
-  tft.setTextSize(3);
-  tft.setCursor(30, 20);
-}
-
 void capture()
 {
   currentPerson = totalPersons - 1;
@@ -1847,25 +1809,6 @@ void getPersonsList(struct personType * persons)
   }
 }
 
-void showMenu()
-{
-      //The blue button navigates through the Menu options
-    blueButton.update();
-    if (blueButton.fallingEdge()) {
-      currentMenuIndex++;
-      currentMenuIndex = currentMenuIndex % menuItemsNum;
-      showMenuEntry(currentMenuIndex);
-    }
-
-    //The red button activates the menu option
-    redButton.update();
-    if (redButton.fallingEdge())
-    {
-      PcControlled = false;
-      currentMenu[currentMenuIndex].function();
-    }
-}
-
 void startInertialEncoderCapture()
 {
   inertialMode = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]