Hello i was wanting to add a lcd display to my project to veiw the Serial Monitor, can anyone help.
here is my code
i have a 1602 Serial 5V Blue Backlight LCD Display
//IR Remote
#include <IRremote.h>
int IR_Recv = 11; //IR Receiver on Pin 11
IRrecv irrecv(IR_Recv); //Initialise IR receiver
decode_results results;
//Stepper
const int pulPin = 10; //Pulse pin at Arduino pin 10
const int dirPin = 9; //Direction pin at Arduino pin 9
const int enblPin = 12; //Enable pin at Arduino pin 12
//const int speedS = 20; //Define speed of stepper (1 is higher speed than 10) should not be less than 20
//Limit switch
const int switchA = 6; //Upper limit switch at pin 6
const int switchB = 7; //Bottom limit switch at pin 7
int inputA = 0; //Store button A data
int inputB = 0; //Store button B data
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Start serial communication at 9600 bauds
irrecv.enableIRIn(); //Starts the receiver
//Stepper
pinMode(pulPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(enblPin, OUTPUT);
digitalWrite(enblPin, LOW); //Enable the Stepper
//Limit switch
pinMode(switchA, INPUT); //Input A
pinMode(switchB, INPUT); //Input B
}
void loop() {
// put your main code here, to run repeatedly:
if (irrecv.decode(&results)){ //If data received from remote
Serial.println(results.value);
if (results.value == 16754775){ //DOWN
Serial.println("GOING DOWN");
goDown();
}
if (results.value == 16736925){ //UP
Serial.println("GOING UP");
goUp();
}
irrecv.resume();
}
delay(10); //Delay of 10ms to avoid errors
}
void goUp(){
digitalWrite(dirPin, LOW); //UP
inputA = digitalRead(switchA); //Check upper limit switch
while(inputA == HIGH){ //Limit switch not pressed
digitalWrite(pulPin, HIGH);
delay(1);
digitalWrite(pulPin, LOW);
inputA = digitalRead(switchA);
delay(1);
}
}
void goDown(){
digitalWrite(dirPin, HIGH); //DOWN
inputB = digitalRead(switchB); //Check bottom limit switch
while(inputB == HIGH){ //Limit switch not pressed
digitalWrite(pulPin, HIGH);
delay(1);
digitalWrite(pulPin, LOW);
inputB = digitalRead(switchB);
delay(1);
}
}