#include "BTS7960.h"
const int buttonPin = 7;
const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;
BTS7960 motor(EN, L_PWM, R_PWM);
void setup()
{Serial.begin(9600);
pinMode(buttonPin, INPUT);
}
void loop() {
int reading = digitalRead(buttonPin);
Serial.println(reading);
if(reading == HIGH) { Push();}
else{ motor.Disable(); }
}
void Push(){
motor.Enable();
motor.TurnRight(50);
delay(10000);
motor.Stop();
motor.Disable();
delay(1000);}