Grupo 4 2020-1 / Mbed 2 deprecated Classe_LCD

Dependencies:   mbed TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Telas.h Source File

Telas.h

00001 /******************************************************************************\
00002  INFORMAÇÕES IMPORTANTES:
00003  
00004     - O endereço padrão para o I2C é 0x7E
00005     - Para utilizar o I2C:
00006         - Configurar no arquivo TextLCD_Config.h a partir da linha 71:
00007         #define DEFAULT        0
00008         (...)
00009         #define YWROBOT        1
00010         (...)
00011     - Site para criar caracteres customizados:
00012     https://maxpromer.github.io/LCD-Character-Creator/
00013         
00014 \******************************************************************************/
00015 
00016 
00017 // I2C Communication
00018 I2C i2c_lcd(PB_9,PB_8); // SDA, SCL
00019 
00020 TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD20x4); // I2C bus, PCF8574 Slaveaddress, LCD Type
00021 
00022     
00023 void LCD_Init(){
00024     
00025 // Turn Backlight on    
00026     lcd.setBacklight(TextLCD::LightOn);
00027     
00028 // Set Cusor Blink off and Blink on
00029     lcd.setCursor(TextLCD::CurOff_BlkOn);
00030     
00031 // Clear screen
00032     lcd.cls();
00033     
00034 }
00035     
00036 void Tela_0(){
00037     lcd.locate(0,0);
00038     lcd.printf("> Pagina 1");
00039     lcd.locate(0,1);
00040     lcd.printf("> Pagina 2");
00041     lcd.locate(0,2);
00042     lcd.printf("> Pagina 3");
00043     lcd.locate(0,3);
00044     lcd.printf("> Pagina 4");
00045     lcd.locate(0,0);    
00046 }
00047 void Tela_1(){
00048     lcd.cls();
00049     lcd.locate(0,0);
00050     lcd.printf("Ola Mundo!");
00051     lcd.locate(0,0);    
00052 }
00053 void Tela_2(){
00054     lcd.cls();
00055     lcd.locate(0,0);
00056     lcd.printf("Bom dia Silvio!");
00057     lcd.locate(0,0);    
00058 }
00059 void Tela_3(){
00060     lcd.cls();
00061     lcd.locate(0,0);
00062     lcd.printf("Como vai voce?");
00063     lcd.locate(0,0);    
00064 }
00065 void Tela_4(){
00066     lcd.cls();
00067     lcd.locate(0,0);
00068     lcd.printf("E isso ai!");
00069     lcd.locate(0,0);    
00070 }