Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Mini Maestro and sound

Hello,

I am new to this board and am curious how I can sync sound with the mini maestro. This is for a Halloween prop with servos and I would like to have them synced with the sound if possible. Does anyone know if this is possible with the mini Maestro?

Thanks!

Hello.

Yes, this is possible. You can configure any channel on a Maestro servo controller as a digital output and then use it to trigger the MP3 trigger. So what you can do is write an internal Maestro script that triggers an MP3 and then starts a servo motion sequence at the same time, and they will be synchronized.

–David

[quote=“DavidEGrayson”]Hello.

Yes, this is possible. You can configure any channel on a Maestro servo controller as a digital output and then use it to trigger the MP3 trigger. So what you can do is write an internal Maestro script that triggers an MP3 and then starts a servo motion sequence at the same time, and they will be synchronized.

–David[/quote]
Thank you David. Also, how would I set up a trigger with a simple NO/NC circuit?
Also, any chance to get a sample of what that script would look like?

Please see the “Using multiple buttons or switches to control servos” example script in the Maestro User’s Guide for an idea of what your script would look like (except you would only have one button, and would add some extra calls to the “servo” command in the “sequence_a” subroutine to change your output line and start the MP3). Please see the “Attaching Servos and Peripherals” section of the Maestro User’s Guide for information about how to wire a switch to the Maestro. The user’s guide can be found here:

pololu.com/docs/0J40

–David

Hi, I also want to play Audio with my Pololu Mini Maestro (12 channel) micro controller. I bought the Sparkfun MP3 Trigger and want to use Serial commands to trigger the mp3 files. I know that I need to connect the TX of the maestro to the RX of the MP3 Trigger in order to send serial commands, but is there an example code for a simple:

-Trigger 001_Track.mp3 if button_1 is pressed
-Trigger 002_Track.mp3 if button_2 is pressed

I coudn’t find the code for the pololu script :confused: . I also have Servos and LED’s connected and working so I just want to add sound to the loops I already wrote.

Thanks in advance!
Sebastian

PS:I don’t want to use the Output solution cause it takes away all my pins for the servos and leds…

Hello, Sebastian.

The following subroutines are examples of how to play a specific MP3 on the MP3 trigger using two different serial trigger commands (which are described in the Serial Control Protocol section of the MP3 trigger’s user’s guide):

[code]# uses the Trigger (ASCII) command to play track 1.
sub trigger_ascii
0x31 0x54 serial_send_byte serial_send_byte
return

uses the Trigger (binary) command to play track 1.

sub trigger_binary
0x01 0x74 serial_send_byte serial_send_byte
return[/code]

Please note that you will have to change the Maestro’s Serial mode to be “UART, fixed baud rate” at 38.4K baud to communicate with the MP3 trigger. Examples of how to call a subroutine if a button is pressed can be found under the “Using a button or switch to control servos” and “Using multiple buttons or switches to control servos” sections of the Maestro’s user’s guide. (By the way, we describe how to use serial under the “Serial output” section of the user’s guide.)

-Jon

Thanks Jon!
That really helped a lot!!!

I read the instructions but never now how to actually write the code in a row.

So for ACSII it is clear now:

sub trigger_ascii
 (ASCII for the Tracknumber: 1 = 0x31) (ASCII for the Trigger command: "T" = 0x54) serial_send_byte serial_send_byte 
   return

same for binary but with other commands :slight_smile:
That really cleared everything up! :smiley:

Thanks again!
Sebastian