i have gotten the serial lcd to display hello however the program seems to ignore the conditional statements. I have looked the code over and it appears fine to me but I'm a beginner. if anyone sees any problem with the excerpt of code below please let me know thank you.
#include <SoftwareSerial.h>
#define rxPin 6 // defines the "read pin or serial in pin" as pin 6 on the arduino proto board (currently not used)
#define txPin 7 // defines the "transfer pin or serial out pin" as pin 7 on the arduino proto board (used to communicate with the lcd)
#define gearfive 13 // defines gearfive to pin 13 on the arduino proto board
#define gearfour 12 // defines gearfour to pin 12 on the arduino proto board
#define gearthree 11 // defines gearthree to pin 11 on the arduino proto board
#define geartwo 10 // defines geartwo to pin 10 on the arduino proto board
#define gearone 9 // defines gearone to pin 9 on the arduino proto board
#define neutral 8 // defines neutral to pin 8 on the arduino proto board
#define reverse 5 // defines reverse to pin 5 on the arduino proto board
#define modeselect 4 // defines the mode selction pin to pin 4
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); // changes the SoftwareSerial command to mySerial command
int sensorPin = A0; // analog read pin for the rpm sensor variable defined as an integer
int RPMvalue = 0; // declares RPMvalue as a variable and sets initial value to 0 variable defined as an integer
void setup()
{
pinMode(rxPin, INPUT); // sets predefined pin to an input pin
pinMode(txPin, OUTPUT); // sets predefined pin to an output pin
pinMode(gearfive, INPUT); // sets predefined pin to an input pin
pinMode(gearfour, INPUT); // sets predefined pin to an input pin
pinMode(gearthree, INPUT); // sets predefined pin to an input pin
pinMode(geartwo, INPUT); // sets predefined pin to an input pin
pinMode(gearone, INPUT); // sets predefined pin to an input pin
pinMode(neutral, INPUT); // sets predefined pin to an input pin
pinMode(reverse, INPUT); // sets predefined pin to an input pin
pinMode(modeselect, INPUT); // sets predefined pin to an input pin
mySerial.begin(9600); // setting baud rate for lcd can be changed to 2400 by adjusting the dip switches on the lcd
delay(1000);
mySerial.print(254, BYTE); //preparing the lcd for commands
delay(100);
mySerial.print(1, BYTE); // command to clear lcd
delay(100);
mySerial.print("Hello");
delay(15000);
}
void loop()
{
if (modeselect == LOW)// if mode selector switch is turned to the off position the gear selection program will be ran
{
if (gearfive == HIGH && gearfour == LOW && gearthree == LOW && geartwo == LOW && gearone == LOW && neutral == LOW && reverse == LOW) // 5th gear
{
mySerial.print(254, BYTE); //preparing the lcd for commands
delay(100);
mySerial.print(1, BYTE); // command to clear lcd
delay(100);
mySerial.print("5th GEAR");// displays "5th GEAR" on the lcd
}