#include <LiquidCrystal_I2C.h>
/* Display */
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.clear();
lcd.backlight();
// Swedish 'ö' => lcd.print("\xef");
// Swedish 'ä' => lcd.print("\xe1");
// Custom Characters for LCD display
// https://omerk.github.io/lcdchargen/
// Pixels for the missing Swedish 'å'
byte customChar0[8] = {
0b00000,
0b00100,
0b01100,
0b00010,
0b01110,
0b10010,
0b01110,
0b00000
};
// Now create a new custom character 'å' => (char)0
lcd.createChar(0, customChar0);
// Swedish 'å' => lcd.write((char)0)
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
lcd.clear();
lcd.backlight();
/*
Det är inte
farten
som dödar
det är smällen!
*/
delay(1000);
lcd.setCursor(3, 0);
lcd.print(F("Det ") ); lcd.print("\xe1"); lcd.print(F("r inte"));
delay(1000);
lcd.setCursor(5, 1);
lcd.print(F("farten"));
delay(1000);
lcd.setCursor(4, 2);
lcd.print(F("som d")); lcd.print("\xef"); lcd.print(F("dar"));
delay(1000);
lcd.setCursor(2, 3);
lcd.print(F("det ")); lcd.print("\xe1"); lcd.print(F("r sm"));
lcd.print("\xe1"); lcd.print(F("llen!"));
delay(2000);
lcd.clear();
lcd.noBacklight();
delay(1000);
/*
It's not
the fart
that kills
it's the smell!
*/
lcd.clear();
lcd.backlight();
delay(1000);
lcd.setCursor(3, 0);
lcd.print(F("It's not"));
delay(1000);
lcd.setCursor(3, 1);
lcd.print(F("the fart"));
delay(1000);
lcd.setCursor(2, 2);
lcd.print(F("that kills"));
delay(1000);
lcd.setCursor(1, 3);
lcd.print(F("it's the smell!"));
delay(2000);
lcd.clear();
lcd.noBacklight();
delay(1000);
// while(1);
}
/*
LCD_I2C
________
| |
Bk GND ---| GND |
Rd VCC ---| VCC |
Yl A4 -<>-| SDA |
Wh A5 ->-| SCL |
|________|
*/