Code
Code
}
void scrollInFromLeft1 (int line, char str1[]) {
i = strlen(str1);
void setup() {
Serial.begin (115200); // initialize serial comms at 115200 baud
Serial.println("Starting test ...");
lcd.begin(16, 2); //16 character by two line display
lcd.clear();
lcd.setCursor(1,0); //set cursor to column 2 row 1
lcd.print("Press a button!");
pinMode(11, INPUT); //clearly defines the input pin at 5 volts
pinMode(12, INPUT); //clearly defines the input pin at 5 volts
}
void loop() {
if (digitalRead(11) == HIGH) {
lcd.clear();
scrollInFromRight(0, "Right to left!!!"); //scrollInFromRight (line to display text
on, string to be scrolled)
lcd.clear();
scrollInFromRight(1, "Right to left!!!");
lcd.clear(); //scroll text one line at a time
}else if (digitalRead(12) == HIGH) {
lcd.clear();
scrollInFromLeft(1, "Left to right!!!");
lcd.clear();
scrollInFromLeft1(0, "Left to right!!!");
lcd.clear();
}
}