#include "./LibButton.h"
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd_i2c(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
#define Boton_1_Pin 15
Button Boton1(Boton_1_Pin);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
lcd_i2c.init(); // initialize the lcd
lcd_i2c.backlight();
}
void MostrarPantalla(bool valor) {
if (valor == true) {
lcd_i2c.display();
lcd_i2c.setCursor(0, 0); // move cursor to (0, 0)
lcd_i2c.print("Hello"); // print message at (0, 0)
lcd_i2c.setCursor(2, 1); // move cursor to (2, 1)
lcd_i2c.print("esp32io.com"); // print message at (2, 1)
} else {
lcd_i2c.noDisplay();
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
if (Boton1.isPressed() == true) {
Serial.println("Boton pulsado");
Serial.println(Boton1.getState());
}
}