Liquid Crystal Display - Arduino | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Arduino - Parallel LCDThe Hitachi HD44789 Controller (or its equivalent) is at the heart of virtually every alpha-numeric LCD display there is. Arduino has a "LiquidCrystal" library to talk directly to these displays.
Based on Arduino Liquid Crystal Tutorial....
#include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { // Create alien array with alien face byte alien[8] = { 31, 21, 31, 31, 10, 10, 27, 0 }; lcd.createChar(1, alien); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world! "); // print the custom character lcd.write(1); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis()/1000); }
|