some help with multitasking Music Maker and Motor shield

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
patrickmal
 
Posts: 6
Joined: Tue Nov 10, 2015 11:41 pm

some help with multitasking Music Maker and Motor shield

Post by patrickmal »

Hi. I'm new to using the Arduino and writing coding, so I could sure use some help. I am working on a project for a model RR that involves a tiny door that opens and closes while some random songs are playing. The music will get louder as the door opens for about 20 seconds and then the door closes for about a minute or two and the music goes very low. And this cycle keeps repeating for several hours. I am stacking both the Adafruit Music Maker MP3 and the Adafruit Motor shield together. For the door that opens and closes, I am using a 180 servo. I have program that randomly plays the Mp3 songs just fine. But I see that I cannot use the delay function for the servo and that the millis function will need to be used to multitask the Arduino. But I'm inexperienced as to using millis and getting the servo to run at the same time.


User avatar
patrickmal
 
Posts: 6
Joined: Tue Nov 10, 2015 11:41 pm

Re: some help with multitasking Music Maker and Motor shield

Post by patrickmal »

Thank you for that post I will definitely read that. But I do have a question, can I stop a servo for a minute or two using "millis" and
that will not effect the music playing?

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: some help with multitasking Music Maker and Motor shield

Post by adafruit_support_bill »

Yes, you can.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”