/* LiquidCrystal Library - Hello World Demonstrates the use a 16x1 LCD display. */ // include the library code: #include // initialize the library with the number of the pins // sclk, mosi, miso (optional), ss) LiquidCrystal_SPI lcd(7,4,6); // some user defined test characters uint8_t smiley[8] = { B00000, B00000, B10001, B00000, B00000, B10001, B01110, B00000, }; uint8_t one[8] = { B00000, B00000, B00000, B00100, B00000, B00000, B00000, B00000, }; uint8_t two[8] = { B00000, B00000, B01110, B01110, B01110, B00000, B00000, B00000, }; uint8_t three[8] = { B00000, B11111, B11111, B11111, B11111, B11111, B00000, B00000, }; uint8_t four[8] = { B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111, }; uint8_t five[8] = { B11111, B11111, B11111, B11011, B11111, B11111, B11111, B11111, }; uint8_t six[8] = { B11111, B11111, B10001, B10001, B10001, B11111, B11111, B11111, }; uint8_t seven[8] = { B11111, B10001, B10001, B10001, B10001, B10001, B10001, B11111, }; uint8_t blank[8] = { B00000, B00000, B00000, B00000, B00000, B00000, B00000, B00000, }; void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 1); // define some programmable characters (only 4 allowed) lcd.createChar(0, smiley); lcd.createChar(1, one); lcd.createChar(2, two); lcd.createChar(3, three); /* lcd.createChar(4, four); lcd.createChar(5, five); lcd.createChar(6, six); lcd.createChar(7, seven); */ // Print a message to the LCD. lcd.print("Hello"); delay(1000); lcd.print(", World!"); lcd.cursor(); lcd.noBlink(); delay(2000); lcd.clear(); } void loop() { // display the character set for (uint8_t i=0;i<16; i++) { for(uint8_t j=0; j<16; j++ ) { lcd.print(char(i*16+j)); delay(50); } delay(2000); lcd.clear(); } delay(3000); }