Thank you, thank you! 
// Open loop motor control example
#include <SimpleFOC.h>
bool doonce = 1;
int debouncetime = 10000;
const int BUTTON_PIN = 10;
int input4Pin = 13;
int input3Pin = 12;
int input2Pin = 11;
int input1Pin = 10;
// this declares each of our buttons and their pins
// make sure that you use the pins your buttons are wired to
// BLDC motor & driver instance
// BLDCMotor motor = BLDCMotor(pole pair number);
BLDCMotor motor = BLDCMotor (7, 5.0, 255.0);
// BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8);
// Stepper motor & driver instance
//StepperMotor motor = StepperMotor(50);
//StepperDriver4PWM driver = StepperDriver4PWM(9, 5, 10, 6, 8);
void setup() {
pinMode(input4Pin, INPUT_PULLUP);
pinMode(input3Pin, INPUT_PULLUP);
pinMode(input2Pin, INPUT_PULLUP);
pinMode(input1Pin, INPUT_PULLUP); // these lines declare each of the buttons as an input
// driver config
// power supply voltage [V]
driver.voltage_power_supply = 12;
// limit the maximal dc voltage the driver can set
// as a protection measure for the low-resistance motors
// this value is fixed on startup
driver.voltage_limit = 12;
driver.init();
// link the motor and the driver
motor.linkDriver(&driver);
// limiting motor current (provided resistance)
motor.current_limit = 0.35; // [Amps]
// open loop control config
motor.controller = MotionControlType::velocity_openloop;
// init motor hardware
motor.init();
Serial.begin(115200);
Serial.println(âMotor ready!â);
Serial.println(âSet target velocity [rad/s]â);
_delay(1000);
motor.disable(); // stops motor
}
void loop() {
// read the state of the switch/button:
int buttonState = digitalRead(BUTTON_PIN);
// print out the buttonâs state
Serial.println(buttonState);
// button on pin 10
if (digitalRead(10)==LOW) { // high state means on
motor.disable(); // stops motor
}
// button on pin 11
if (digitalRead(11)==LOW) { // high state means on
motor.move(28.954); // this button sets the speed to 33.3rpm
}
// button on pin 12
if (digitalRead(12)==LOW) { // high state means on
motor.move(39.071); // this button sets the speed to 45rpm
}
// button on pin 13
if (digitalRead(13)==LOW) { // high state means on
motor.enable(); // starts motor
doonce = 1;
delay(debouncetime);
}
}