Servo now working when using AudioOutputAnalog

Status
Not open for further replies.

ftrias

Well-known member
I'm creating a project with Servo and wanted to use the Audio library. However, when I include an AudioOutputAnalog object, Servo stops working. All the other Audio objects (AudioMixer4, AudioConnection, etc.) work fine. Even AudioOutputPWM works. But the servo just stops when I include an instance of AudioOutputAnalog, even I don't refer to it anywhere else.

For example the code below doesn't work. If I comment out the AudioOutputAnalog line, it works.

Anybody seen this before or have any ideas?

Code:
#include <Servo.h> 
#include <Audio.h>

AudioOutputAnalog        out;        // if line included, Servo stops working
//AudioOutputPWM        pwm;      // this line works OK

Servo myservo;  

void setup() { 
  myservo.attach(9);
}  
 
void loop() { 
  myservo.write(45);
  delay(500);
  myservo.write(135);
  delay(500);
}
 
Status
Not open for further replies.
Back
Top