Hello all,
I am using a 16X2 char. LCD for a project I am working on and it was working fine before. However it has started to malfunction a bit.
For Example, It is supposed to first read "Enter Length"
Once a length is entered it is supposed to say "Coating"
Then a series of other short messages.
However when I turn it on it will read Enter Length but will not show any other text throughout the program. I have included by code for reference.
Any advice is appreciated,
also i did not solder the wires on just kinda bent and crimped them around the leads of the LCD, I made sure they are not touching each other and it appears they are all touching the gold parts.
Thank you!
#include <Stepper.h>
#include <Keypad.h>
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(32,3,4,26,24,22);
// -------------------------KEYPAD------------------------
const byte ROWS = 4; // Four rows
const byte COLS = 3; // Three columns
// Define the Keymap
void setup()
{
lcd.begin(16, 2);
pinMode(motorPin1, OUTPUT); // Actuator #1
pinMode(motorPin2, OUTPUT); // Actuator #2
pinMode(motorPin3, OUTPUT); // Actuator #3
pinMode(motorPin4, OUTPUT); // Actuator #4
pinMode(Direction, OUTPUT);
pinMode(Sleep, OUTPUT);
pinMode(StepPin, OUTPUT);
Serial.begin(9600); // open the serial port at 9600 bps:
}
void loop()
{
Count_2 = 0;
digitalWrite(Sleep, LOW); // Turn off power to stepper motor
lcd.clear();
lcd.setCursor(0, 0); // sets LCD cursor
lcd.print("Enter Length: ");
Keypad_func(); // Go to Keypad Function
Serial.println(Length); // This is used for testing purposes
Length_Converter(); // Go to funtion to convert cm length to # of steps
// *******************************
// COATING PROCESS BEGINS
// *******************************
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(" Coating ");
delay (1000);
lcd.setCursor(0, 0); // Sets LCD to print "Coating"
lcd.print(" Coating ");
Serial.print("Motor Initial Forward"); // Testing purposely only
Serial.print("\n"); // For Testing
int DirectionToggle = 1; // Just a Toggle for the Direction Flag
digitalWrite(Direction,DirectionToggle); // Sets up Direction of motor
delay(250);
digitalWrite(Sleep, HIGH); // Gives power back to the Stepper Motor
for (int fwd = 0; fwd < 4620; fwd++) // Move stepper motor a set distance to the funnel opening
{
digitalWrite(StepPin,HIGH);
delayMicroseconds(1000);
digitalWrite(StepPin,LOW);
delayMicroseconds(1000);
}
delay(1);
// *************************************************************
// Begin Dispersion
// *************************************************************
for (Repeat = 0; Repeat < 11; Repeat ++) // Loop 10 times moving forward and backwards 5 times each
{
digitalWrite(motorPin1, HIGH); // Turn on Actuator 1
digitalWrite(motorPin2, HIGH); // Turn on Actuator 2
digitalWrite(motorPin3, HIGH); // Turn on Actuator 3
digitalWrite(motorPin4, HIGH); // Turn on Actuator 4
Dispersion(); // Call the Dispersion Function and read in the Length varaiable *note* need to call in length variable
}
// *************************************************************
// Dispersion Finished
// *************************************************************
digitalWrite(motorPin1, LOW); // Turn off Actuator 1
digitalWrite(motorPin2, LOW); // Turn off Actuator 2
digitalWrite(motorPin3, LOW); // Turn off Actuator 3
digitalWrite(motorPin4, LOW); // Turn off Actuator 4
Serial.print("Motor Final Forward"); // For Testing
Serial.print("\n"); // For Testing
digitalWrite(Direction,DirectionToggle = 1);
delay(100);
for (int fwd = 0; fwd < 5030; fwd++)
{
digitalWrite(StepPin,HIGH);
delay(1);
digitalWrite(StepPin,LOW);
delay(1);
}
digitalWrite(Sleep, LOW);
Serial.print("Done Coating"); // For Testing
Serial.print("\n"); // For Testing
delay (500);
lcd.setCursor(0, 0);
lcd.print("Finished Coating");
lcd.setCursor(0, 1);
lcd.print("Press Any Button");
delay (500);
Restart();
lcd.clear();
delay (500);
return;
}
void Restart()
{
char key = kpd.getKey(); // Read keypad value
if (key != NO_KEY)
{
Serial.print("Return Steps: ");
lcd.setCursor(0, 0);
lcd.print(" Returning ");
digitalWrite(Sleep, HIGH);
digitalWrite(Direction,DirectionToggle = 0);
ret_tot = 10030 + Length_1;
Serial.println(ret_tot); // For Testing
Serial.print("\n");
for (int ret = 0; ret < ret_tot; ret++)
{
digitalWrite(StepPin,HIGH);
delay(1);
digitalWrite(StepPin,LOW);
delay(1);
}
}
else
{
Restart();
}
}
*I attached my entire script as well due to character limitations in the code
Code_4_8_15.ino (12.8 KB)