#include Servo ESC; // create ESC object to control a servo // twelve servo objects can be created on most boards int PulseRate = 1200; // variable to store the BLDC pulse rate. void setup() { ESC.attach(PIN_PA3, 1000, 2000); // attach Signal pin to pin 3, set minimum pulse width and maximyum pulse width in microseconds). } void loop() { for (PulseRate = 1200; PulseRate <= 1800; PulseRate += 1) { // goes from a little over min to a little under max pulse rate. // Make sure these pulse rates are compatible with all BLDC motors. // in steps of 1 microsecond. (this is probably too slow) ESC.write(PulseRate); // tell servo to go to position in variable 'pos' delay(1000); // waits 1s } for (PulseRate = 1800; PulseRate >= 1200; PulseRate -= 1) { // goes from 180 degrees to 0 degrees ESC.write(PulseRate); // tell servo to go to position in variable 'pos' delay(1000); // waits 1 s } }