I tried to develop a small project, how ever after a short time I ran into problems with the servo. I think I found a bug (other have reported similar problems https://github.com/voodootikigod/voodoospark/issues/32).
I made a small project to reproduce the problem. Connect the servo to vin and gnd. Connect the controll pin to port A0 of the core. Then connect a push button to 3V3 and D0. If you run the following programm:
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(A0); // attaches the servo on the A0 pin to the servo object
pinMode(D0, INPUT_PULLDOWN);
pinMode(A1, OUTPUT);
}
void loop()
{
if(digitalRead(D0) == HIGH) {
myservo.write(20);
analogWrite(A1, 255);
}
delay(10);
}
As soon as you press the button the servo tries to do someting strange (reach an unreachable position) and makes some noise. (I guess you need to disconnect the servo fast as this might destroy it.)
The problem does not appear if you connect the servo to pin A7. (Until now I could not get the servo work on pin A0 on the Particle Photon at all, on A5 it works fine.)
Can someone confirm this problem?