Hey everyone,
I've created a library to use the VMusic3 USB/MP3/WMA module:
http://www.retrojdm.com/Files/VMusic3.zip
Main Features
- Play / Pause / Stop
- Fast-forward / Rewind
- Next / Prev track
- Next / Prev folder (walks directory tree, stopping on folders with MP3/WMA files)
- Set volume
- "Keep Playing" mode automatically goes to the next track (or folder)
- "Random" mode chooses a random track in the current folder
- When playing, returns track position in seconds
- When a USB is detected, can find first track on USB or load a specific file
- Can tell you the current path and filename
See the included examples or vmusic.h file for all the public attributes and functions.
VMusic3 vs VMusic2
If anyone has a VMusic2 they can test this on, I'd love to hear how you go. The library was written for firmware version "V2MSC1.0.0".
SPI
The library uses SPI instead of the default UART, so don't forget to change the jumper pin
NPN Transistor
Also, the VMusic3 5V power should be switched using an NPN Transistor (Eg: BC548). This is only necessary if you don't want to disconnect then reconnect power to the Arduino every time you reset/reupload a sketch.
Collector: Arduino 5V
Base: Arduino Digital IO used to switch the VMusic on.
Emitter: VMusic 5V
Have a read of the vmusic.h and vmusic.cpp files. There's lots of comments explaining everything in there.
I've also included 2 examples in the library to get you started.
Arduino Car Stereo
If you want to see how the library can be used in a more advanced way, here's a link to my Arduino Car Stereo project:
Andrew