H bridge program

I'm trying to use the L293D H-bridge to get a motor to go in one direction when button one is pressed and in a different direction when button two is pressed. and then for the motor to not move when both or neither button is pressed. I tried using the arduino project book that i have that goes over a zeotrope but the programing is designed for a different use case. I've had a hard time figuring out how to code the program. I'm pretty new to coding in general and i really hope someone can help me. the sketch Ive written is as follows. thank you in advance.

int controlPin1 = 2;

int controlPin2 = 3;

int enablePin = 8;

int fSS = 4; //forewardSwitchState

int rSS = 5; //rearwardSwitchState

void setup() {

pinMode(fSS, INPUT);

pinMode(rSS, INPUT);

pinMode(controlPin1, OUTPUT);

pinMode(controlPin2, OUTPUT);

pinMode(enablePin, OUTPUT);

digitalWrite(enablePin, LOW);

Serial.begin(9600);

}

void loop() {

if ((fSS == HIGH) and (rSS == LOW)) {

digitalWrite(enablePin, HIGH);

digitalWrite(controlPin1, HIGH);

digitalWrite(controlPin2, LOW);

Serial.print("Foreward button pushed");

}

if ((rSS == HIGH) and (fSS ==LOW)) {

digitalWrite(enablePin, HIGH);

digitalWrite(controlPin1, LOW);

digitalWrite(controlPin2, HIGH);

Serial.print("Rearward button pushed");

}

if ((rSS == HIGH) and (fSS == HIGH)) {

digitalWrite(enablePin, LOW);

digitalWrite(controlPin1, LOW);

digitalWrite(controlPin2, HIGH);

Serial.print("Both buttons pushed \'0'/ "); }

if ((rSS == LOW) and (fSS == LOW)) {

digitalWrite(enablePin, LOW);

digitalWrite(controlPin1, HIGH);

digitalWrite(controlPin2, LOW);

Serial.print("Neither button pushed -_-");

}

}

kmatt999: ``` int fSS = 4; //forewardSwitchState int rSS = 5; //rearwardSwitchState

void setup() {  pinMode(fSS, INPUT);  pinMode(rSS, INPUT);

 if ((rSS == HIGH) and (fSS ==LOW)) {

Those are pin numbers. You have to use digitalRead(pinNumber) to get the state of the pin.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :)