Skip to content

Instantly share code, notes, and snippets.

@dtanphat9388
Created April 29, 2018 21:17
Show Gist options
  • Save dtanphat9388/fdd96debeeb8d30973f2737772c0b85e to your computer and use it in GitHub Desktop.
Save dtanphat9388/fdd96debeeb8d30973f2737772c0b85e to your computer and use it in GitHub Desktop.
/*
USE LIBRARY
*/
// b1: use library LiquidCrystal
#import <LiquidCrystal.h>
// b2: khởi tạo biến chứa thông tin các pin
// chọn 1 trong các khởi tạo sau:
// thay thế các tham số bên dưới ứng với các pin trên arduino
LiquidCrystal lcd(rs, enable, d4, d5, d6, d7); // recommended
LiquidCrystal lcd(rs, rw, enable, d4, d5, d6, d7);
LiquidCrystal lcd(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7);
LiquidCrystal lcd(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7);
/*
COMMAND LIST IN LIBRARY
*/
// setup
lcd.begin();
// send data to lcd
print(); // send string
write(); // send character
// cursor control
home();
setCursor();
scrollDisplayLeft();
scrollDisplayRight();
leftToRight(); // sau khi clear phai setCursor
rightToLeft();
noCursor(); // hide underline cursor
cursor(); // display underline cursor of next character
// UNKNOWN
autoscroll(); // dependend in leftToRight or rightToLeft
noAutoscroll();
createChar();
//display cursor
display();
noDisplay();
blink();
noBlink();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment