/*
BigNumbers_I2C https://github.com/Anush-DP/BigNumbers_I2C
*/
#include <LiquidCrystal_I2C.h>
#include "BigNumbers_I2C.h"
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
BigNumbers_I2C bigNum(&lcd); // construct BigNumbers object, passing to it the name of our LCD object
void setup()
{
TCCR1B = TCCR1B & 0b11111000 | 0x01; // use for Arduino Uno
// TCCR2B = TCCR1B & 0b11111000 | 0x01; // use for Arduino Mega2560
lcd.begin(16,2); // setup LCD rows and columns
bigNum.begin(); // set up BigNumbers
lcd.clear(); // clear display
}
void loop()
{
int currentTime = millis() / 100; // assigns the current time since boot in tenths of a second to currentTime
byte lastDigit = currentTime % 10;
currentTime = currentTime /= 10;
bigNum.displayLargeInt(currentTime, 0, 0, 4, true);
//bigNum.displayLargeInt(currentTime, 0, 0, 4, false);
// print out the decimal point and the digit after it
lcd.setCursor(12, 1);
lcd.print(".");
lcd.print(lastDigit);
}