- Arduino +5V --> Module VCC
- Arduino GND --> Module GND
- Arduino Analoog 4 --> Module SDA
- Arduino Analoog 5 --> Module SCL
#include "Wire.h"
#include "LiquidCrystal_I2C.h"
LiquidCrystal_I2C lcd(0x3f,20,4); // set the LCD address to 0x3f for a 20 chars and 4 line display
void setup()
{
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Hello Arduino");
lcd.setCursor(0,1);
lcd.print("DCcEle LCD Print");
lcd.setCursor(0,2);
lcd.print("2004A LiquidCrystal I2C");
lcd.setCursor(0,3);
lcd.print("Show!");
}
void loop()
{
}
沒有留言:
張貼留言