Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Uno I2C LCD Display Project

View and Edit Project In Cirkit DesignerImage of Arduino Uno I2C LCD Display Project

Circuit Documentation

Summary

This circuit consists of an Arduino Uno R3 microcontroller, a 16x2 I2C LCD display, and a toggle switch. The Arduino Uno R3 is used to control the LCD display, which shows messages in a loop. The toggle switch is included in the circuit but is not connected to any other components in this configuration.

Component List

Arduino Uno R3

16x2 I2C LCD

Toggle Switch SPST

Wiring Details

Arduino Uno R3

16x2 I2C LCD

Toggle Switch SPST

Code Documentation

Arduino Uno R3 Code

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows

void setup()
{
  lcd.init(); // initialize the lcd
  lcd.backlight();
}

void loop()
{
  lcd.clear();                 // clear display
  lcd.setCursor(0, 0);         // move cursor to   (0, 0)
  lcd.print("Arduino");        // print message at (0, 0)
  lcd.setCursor(2, 1);         // move cursor to   (2, 1)
  lcd.print("GetStarted.com"); // print message at (2, 1)
  delay(2000);                 // display the above for two seconds

  lcd.clear();                  // clear display
  lcd.setCursor(3, 0);          // move cursor to   (3, 0)
  lcd.print("DIYables");        // print message at (3, 0)
  lcd.setCursor(0, 1);          // move cursor to   (0, 1)
  lcd.print("www.diyables.io"); // print message at (0, 1)
  delay(2000);                  // display the above for two seconds
}

This code initializes the 16x2 I2C LCD display and continuously loops through two messages, displaying each for two seconds. The setup() function initializes the LCD and turns on the backlight. The loop() function clears the display, sets the cursor position, prints the messages, and introduces a delay to keep the messages on the screen for two seconds each.