Hi,
Im using Blue Pill on Arduino IDE
I have no clue why the servo library is only working on some ports.
As long as I use PA6, 7, 8, 9, 10 the software works.
Once I define PB12, 13, 14, 15 OR PA11, 12, 15, It fails.
Or is the library limited to certain pins to be used for servo?
This is the code as example for PA15 => Not working.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(PA15); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}