Arduino - lcd.begin()

Description

Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display. begin() needs to be called before any other LCD library commands.

Syntax

lcd.begin(cols, rows)

Parameters

  • lcd: a variable of type LiquidCrystal
  • cols: the number of columns that the display has
  • rows: the number of rows that the display has

Example

Hardware Required

1×Official Arduino Uno
1×Alternatively, DIYables ATMEGA328P Development Board
1×USB 2.0 cable type A/B
1×LCD
1×Potentiometer
1×Alternatively, Potentiometer Kit
1×Alternatively, Potentiometer Module with Knob
1×Breadboard
1×Jumper Wires
Disclosure: Some links in this section are Amazon affiliate links. If you make a purchase through these links, we may earn a commission at no extra cost to you.
Additionally, some links direct to products from our own brand, DIYables .

Wiring Diagram

Arduino LCD Wiring Diagram

This image is created using Fritzing. Click to enlarge image

Arduino Code

#include <LiquidCrystal.h> LiquidCrystal lcd(11, 12, 2, 3, 4, 5); void setup() { lcd.begin(16, 2); // set up the LCD 16x2 lcd.print("hello, world!"); // print a message to the LCD } void loop() {}

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit

※ OUR MESSAGES