Hackster is hosting Hackster Cafe: Open Hardware Summit. Watch the stream live on Friday!Hackster is hosting Hackster Cafe: Open Hardware Summit. Stream on Friday!
jehankandt
Published © Apache-2.0

Arduino LCD 16x2 display with I2C for loop

How to display countdown using for loop

AdvancedFull instructions provided2,103
Arduino LCD 16x2 display with I2C for loop

Things used in this project

Story

Read more

Schematics

Arduino 16x2 Display I2C for loop

Arduino 16x2 Display I2C for loop

Code

Arduino 16x2 Display I2C for loop

C/C++
Arduino 16x2 Display I2C for loop
//...............JehanKandy........................
//...........www.jehankandy.com....................
//........www.github.com/JehanKandy................

//..............LCD Display........................
//..............I2C Module.........................



//include liquidCrystal_I2C.h and install 
//Tools -> Manage Libraries and type liquidCrystal_I2C then install

#include <LiquidCrystal_I2C.h>

//define I2C address......
LiquidCrystal_I2C lcd(0x27,16,2);


void setup() {
  lcd.init();
  lcd.clear();
  lcd.backlight();

  lcd.setCursor(2,0);
  lcd.print("Hello World");

  lcd.setCursor(1,1);
  lcd.print("LCD Display I2C");
  delay(2000);
  
  lcd.clear();
}

void loop() {
  for(int i = 0; i <= 20; i++){
    lcd.setCursor(2,0);
    lcd.print(i);
    delay(100);
    lcd.clear();
  }

}
//.........coded by : JehanKandy....
//...........Thank You..............

Credits

jehankandt
21 projects • 8 followers
Contact

Comments

Please log in or sign up to comment.