Skip to content

Instantly share code, notes, and snippets.

@atchoo78
Last active June 5, 2020 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atchoo78/b27a21f9ffd55381088f06d9718e8550 to your computer and use it in GitHub Desktop.
Save atchoo78/b27a21f9ffd55381088f06d9718e8550 to your computer and use it in GitHub Desktop.
LiquidCrystal I2C - LCD display test on Arduino Uno
// Note: I recommend connecting SCL and SDA from the LCD to Analog 4 & 5 on the Uno.
// You can also use the SCL and SDA ports (near the USB).
// In general: 16 chars, 2 or 4 lines of text: 0x27
// 20 chars, 4 lines of text: 0x3F
// But remember that most of these i2c adapters are addressable
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.begin();
lcd.setCursor(0,0);
for (int pos = 0; pos < 15; pos++) {
lcd.print(pos);
}
}
void loop() { // do nothing here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment