//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
// C++ code
//
float seconds1 = 0;
unsigned long tempo1 = 0;
unsigned long tempo2 = 0;
void setup()
{
lcd.init();
tempo1 = millis();
pinMode(8,INPUT_PULLUP);
pinMode(9,INPUT_PULLUP);
}
void loop()
{
if(digitalRead(8) == 0)
{
tempo2 = millis();
seconds1 = (tempo2 - tempo1)/1000;
}
lcd.setCursor(0,0);
lcd.print(seconds1);
}