Arduino - lcd.write()
Description
Write a character to the LCD.
Syntax
lcd.write(data)
Parameters
- lcd: a variable of type LiquidCrystal
- data: the character to write to the display
Returns
- Return the number of bytes written, though reading that number is optional
Example
Hardware Required
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

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
Serial.begin(9600);
}
void loop()
{
if (Serial.available()) {
lcd.write(Serial.read());
}
}
See Also
※ ARDUINO BUY RECOMMENDATION
Arduino UNO R3 | |
Arduino Starter Kit |