Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- To interface a 16x2 LCD with Arduino, you can use the LiquidCrystal library. Here's a simple example:
- RS => Arduino Pin 7
- EN => Arduino Pin 8
- D4 => Arduino Pin 9
- D5 => Arduino Pin 10
- D6 => Arduino Pin 11
- D7 => Arduino Pin 12
- */
- #include <LiquidCrystal.h>
- // Initialize the LCD and specify the GPIO pins
- LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
- void setup() {
- // Set up the LCD's number of columns and rows:
- lcd.begin(16, 2);
- // Print a message to the LCD
- lcd.setCursor(0, 0);
- lcd.print("Hello, world!");
- lcd.setCursor(0, 1);
- lcd.print("Arduino");
- }
- void loop() {
- // No need to repeat anything in the loop for this simple example
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement