Hi so I am an intermediate Arduino user and coder. I currently am building a project that will open a door with a servo and when the door is open it will play music. Currently I can move the servo with ease with the Servo.h library through serial connection but when I play music through the TMRpcm.h library I can no longer move the servo
The full code is extensive but this is a simplified version:
if (Serial.available() > 0 )
{
Incoming_value = Serial.read();
if (Incoming_value == 'A')
{
ser.write(125);
}
else if (Incoming_value == 'B')
{
tmrpcm.setVolume(3);
tmrpcm.play("Doorbell.wav");
delay(5000);
tmrpcm.stopPlayback();
//tmrpcm.disable();
}
else if (Incoming_value == 'C')
{
ser.write(0);
}
}
This is the simplified code that I have used to debug. I can send A and C and it will move back and forth. When I send B for the bell sound it will play it but when I try and move the servo again it will not do anything (Unless I reset the program). I can still play the bell over and over again however.
I have tried both tmrpcm.stopPlayback(); and tmrpcm.disable(); or neither and it does the same thing for the servo motor sake where it will stop moving
Is there something going on in the background with the TMRpcm.h library that I am probably not aware of that would be interfering with the servo library? or any other suggestions that I am overlooking