Arduino - lcd.cursor()

Description

Display the LCD cursor: an underscore (line) at the position to which the next character will be written. This function is opposite to lcd.noCursor()

Syntax

lcd.cursor()

Parameters

  • lcd: a variable of type LiquidCrystal

Example

Hardware Required

1×Arduino UNO or Genuino UNO
1×USB 2.0 cable type A/B
1×LCD
1×Potentiometer
1×Breadboard
1×Jumper Wires
1×(Optional) 9V Power Adapter for Arduino
1×(Recommended) Screw Terminal Block Shield for Arduino Uno
1×(Optional) Transparent Acrylic Enclosure For Arduino Uno
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.

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() { lcd.noCursor(); // turn off the cursor delay(500); lcd.cursor(); // turn on the cursor delay(500); }

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit

※ OUR MESSAGES