Patrick Fitzgerald
Published © GPL3+

ASCII Demo sketch for HD44780 LCD Display

How about a quick demo that cycles through the whole character set.

IntermediateProtip1 hour49

Story

Read more

Code

ASCIIdemoLCD

Arduino
Arduino sketch that works with DFRobot LCD Shield
scrolls through ASCII character set
#include <LiquidCrystal.h>
// DFRobot shield Uno connections Enable 8, RS 9, data 4, 5, 6, 7
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 
const int numRows = 2;  const int numCols = 16;
void setup(){ lcd.begin(numCols, numRows); }
void loop() {
  for (byte thisLetter = '!'; thisLetter <= '~'; thisLetter++) {
    // loop over the columns:
    for (int  thisRow = 0; thisRow < numRows; thisRow++) {
      // loop over the rows:
      for (int thisCol = 0; thisCol < numCols; thisCol++) {
        // set the cursor position:
        lcd.setCursor(thisCol, thisRow);
        // print the letter then increment
        lcd.write(thisLetter++);
        delay(300);    }}}}

Credits

Patrick Fitzgerald

Patrick Fitzgerald

110 projects • 37 followers

Comments