//#include <RTClib.h>
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int stepPin = 6;
const int dirPin = 7;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.print("Thanks for using me!"); //displays "thanks for using me!"
delay(1000); //delays for 1s
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
Stepper();
LCD();
}
void Stepper() {
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
for(int x = 0; x < 800; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(500); // One second delay
}
void LCD() {
// scroll 13 positions (string length) to the left to move it offscreen left
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayLeft(); // scroll one position left:
delay(350);//waits 350ms
}
// scroll 29 positions (string length + display length) to the right to move it offscreen right
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
lcd.scrollDisplayRight(); //scrolls to the right
delay(350); //waits for 350ms
}
//new line
delay(1000);
lcd.clear();
lcd.print("Consult manual for setup."); // Displats "consult manual for setup."
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayLeft(); // scroll one position left:
delay(350);//waits 350ms
}
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
lcd.scrollDisplayRight(); //scrolls to the right
delay(350); //waits for 350ms
}
//new line
delay(1000);
lcd.clear();
lcd.print("please select time 1: AM");
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayLeft(); // scroll one position left:
delay(350);//waits 350ms
}
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
lcd.scrollDisplayRight(); //scrolls to the right
delay(350); //waits for 350ms
}
//new line
delay(1000);
lcd.clear();
lcd.print("please select time 2: PM");
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayLeft(); // scroll one position left:
delay(350);//waits 350ms
}
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
lcd.scrollDisplayRight(); //scrolls to the right
delay(350); //waits for 350ms
}
delay(5000); // delays for 2s
}