#include <LiquidCrystal.h>
int rs = 7;
int en = 8;
int d4 = 9;
int d5 = 10;
int d6 = 11;
int d7 = 12;
int primerNum = 0;
int segundoNum = 0;
int resultado = 0;
char op = " ";
LiquidCrystal lcd(rs, en , d4, d5, d6, d7);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16, 2);
Serial.println("Calculadora");
lcd.print("Calculadora");
delay(1000);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0 ,0);
lcd.print("Primer numero: ");
while (Serial.available() == 0) {}
primerNum = Serial.parseFloat();
Serial.println(primerNum);
delay(500);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Segundo numero: ");
while (Serial.available() == 0) {
}
segundoNum = Serial.parseFloat();
Serial.println(segundoNum);
delay(500);
lcd.clear();
lcd.setCursor(0, 0);
lcd.println();
}