#include <AFMotor.h>
AF_DCMotor motor(1);
const int buttonPin3 = 7;
const int buttonPin4 = 6;
int buttonState3 = 0;
int buttonState4 = 0;
void setup() {
pinMode(buttonPin3, INPUT_PULLUP);
pinMode(buttonPin4, INPUT_PULLUP);
pinMode(12, OUTPUT);
pinMode(9, OUTPUT);
}
void loop() {
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
if (buttonState3 == LOW) {
digitalWrite(12, HIGH);
digitalWrite(9, LOW);
analogWrite(3,255);
delay(5);
}
if (buttonState4 == LOW) {
digitalWrite(12,LOW);
digitalWrite(9,LOW);
analogWrite(3,255);
delay(5) ;
}
else if (buttonState3 == HIGH) {
digitalWrite(9,HIGH);
delay(5);
}
}