// LCD1602 to Arduino Uno connection example
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
float tempo;
void setup() {
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
lcd.setCursor(2,0);
lcd.print("Hello World!");
Serial.begin(9600);
}
void loop() {
// ...
//lcd.clear();
//lcd.home();
lcd.setCursor(0,1);
tempo = millis();
tempo = tempo/1e3;
lcd.print("Tempo:");
lcd.print(tempo,2); //Usar 2 casas para o tempo
lcd.print(" [s] ");
Serial.print("Tempo: ");
Serial.print(tempo);
Serial.println(" [s] ");
delay(100);
}