Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions examples/AutoFindAddress/AutoFindAddress.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Auto detect LCD address between 0x3F or 0x27
byte autolcdaddr(){
Wire.begin();
Wire.beginTransmission(0x27);
return Wire.endTransmission()? 0x3F:0x27;
}


// Set the LCD for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(autolcdaddr(), 16, 2);

void setup()
{
// initialize the LCD
lcd.begin();

// Turn on the blacklight and print a message.
lcd.backlight();
lcd.print("Hello, world!");
}

void loop()
{
// Do nothing here...
}