Menu para a IHM

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld2 by Wim Huiskamp

Revision:
7:a550ec99045b
Parent:
6:49a35089f51b
diff -r 49a35089f51b -r a550ec99045b main.cpp
--- a/main.cpp	Mon May 07 20:56:41 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* Hello World! for the TextLCD Enhanced Library*/
-
-#include "mbed.h"
-#include "TextLCD.h"
-//#include "TextLCDScroll.h"
-DigitalIn button1(D5);
-DigitalIn button2(D4);
-
-DigitalOut led(LED2);
- 
-// Host PC Communication channels
-Serial pc(USBTX, USBRX); // tx, rx
- 
-// I2C Communication
-I2C i2c_lcd(D14,D15); // SDA, SCL
-
-
-TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD20x4);                  // I2C exp: I2C bus, PCF8574 Slaveaddress, LCD Type
-
-bool saida=0;
-
-
-int main() {   
-
-    lcd.setBacklight(TextLCD::LightOn);
-    lcd.setCursor(TextLCD::CurOff_BlkOn);
- 
- 
-  while(1){
-        while (button1==1 and button2==1){
-            saida=0;
-            lcd.setAddress(0,0);
-            lcd.printf("SELECIONAR PONTO? ");
-            lcd.setAddress(0,2);
-            lcd.printf("1-SIM");
-            lcd.setAddress(0,3);
-            lcd.printf("2-NAO");
-            }
-            if (button1==0){
-                lcd.cls();
-                while(1){
-                    lcd.setAddress(0,0);
-                    lcd.printf("SELECIONE O PONTO 1");
-                    lcd.setCursor(TextLCD::CurOff_BlkOff);
-                    lcd.setAddress(0,2);
-                    lcd.printf("1-PROXIMO PONTO");
-                    lcd.setAddress(0,3);
-                    lcd.printf("2-VOLTAR");
-                    if (button1==0){
-                        lcd.cls();
-                        while(1){
-                            lcd.setAddress(0,0);
-                            lcd.printf("SELECIONE O PONTO 2");
-                            lcd.setCursor(TextLCD::CurOff_BlkOff);
-                            lcd.setAddress(0,2);
-                            lcd.printf("1-PROXIMO PONTO");
-                        }
-                        
-                    }
-                    if (button2==0){
-                        lcd.cls();
-                        saida = 1;
-                        break;
-                    }
-                }
-            }
-            if (button2==0 and saida==0){
-                lcd.cls();
-                while(1){
-                    lcd.setAddress(5,1);
-                    lcd.printf("OPERACAO");
-                    lcd.setCursor(TextLCD::CurOff_BlkOff);
-                    lcd.setAddress(5,2);
-                    lcd.printf("CANCELADA");
-                    
-                }
-            }
-    }
-}             
-
-