Arduino – CLCD with I2C – Typing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // or 0x3F String str="Hello World!"; void setup() { lcd.init(); delay(1000); lcd.backlight(); lcd.setCursor(0,0); lcd.print(str); lcd.cursor(); lcd.blink(); delay(1000); } void loop() { lcd.clear(); lcd.setCursor(0,0); lcd.print(str); lcd.setCursor(0,1); for (int i=0;i<str.length();i++) { lcd.print(str[i]); delay(300); } delay(2000); } |