Woah, yeah, good idea not posting the entire text of the code here. If the functions do what they sound like they do, you should be able to fold your roulette code into this one, and call something like SetTrack(single_zero_wheel[pot_idx]), then call PlayMusic(). I think this will play the correct track, but it will then start playing other tracks as well. You could change the line:
#define DEFAULT_MODE 0
#define DEFAULT_MODE 1
Which should make the player repeat one track over and over again, which is not quite what you want (or is it?).
It looks like you would need to edit the PlayMusic function to get it to play a track only once. It looks like you should just be able to remove the line “goto next;” from near the end of the function, but without the hardware to test it on myself I can’t say any of this for sure. Alternatively you could just add really long pauses to the end of your MP3 files.
Since the chip directly reads the files form the SD card and plays the MP3’s I don’t see how anything you’re doing from your microcontroller could make it play slowly. My guesses would be that the chip either disagrees with the formatting of your mp3 files somehow, or that it’s own clock is slower than it expects (scratch that, you got a prefab board from SparkFun, you might want to ask about it there). Those are just guesses though.
The mechanical engineering programs I went through were very focused on theory rather than practical implementation (I think a mix of both would have been much better). I had one required “electromechanical systems” course, which focused almost entirely on the physical makeup of different semiconductor devices (the differently doped layers of silicon in transistors for example), and we did some very basic analog circuit design. I think we had one lab where we got to type up (copied directly from a handout) a simple LED flashing PIC program and download it into a chip, with little explanation of what we were doing or how it worked.
You’re absolutely right that it’s hard to teach yourself, especially when you have other courses to keep up with, and robotics is hard to get into as an undergraduate. For me it was primarily a problem of motivation (vs the immediate gratification of going out to movies than staying up playing Super Smash Brothers all night). One thing that really helped me was taking some excellent elective classes in programming general robotics, especially ones that were more lab-focused with semester-long group projects. The group and your grade in the class are good motivation, plus when you’re doing it for your own knowledge and course credit you feel like your getting double back (also, you can generally take graduate courses as undergraduate electives if you ask). I also totally lucked out my sophomore year and landed a student job in a robotics research lab. There were lots of electronics and software guys working there already, but no one working on the student projects knew how to use a decent CAD program. My high school required a semester of manual drafting (probably a holdover from when it was more of a trade school) and a semester of CAD modeling, so I got to participate in a bunch of different projects and learn all about them along the way.
Another thing you might think about is joining a robotics club, either through a school or your region. I never had the time (between extra classes and research projects), but from everyone I know who’s been in one says it was a great experience and source of information and resources, not to mention the most important part (to me anyway), the motivation.
That was right by my high school (the oddly shaped brown building in the background) in lower Manhattan in January 2000. Right here actually. That close to the ocean the Hudson river is salt-water, so it very rarely freezes over, but freshwater from snow falling on the river tends to form these little icebergs that get stuck in little harbors between piers. The bergs are small and moving in waves, the spaces between are just floating slush, and every year or two someone doing exactly what I did falls between pieces of ice and drowns (which I did not know at the time). Actually in two of the pictures I’m slowly standing up after falling on my back, miraculously right smack in the middle of a very large piece of ice. I think that was when we all stopped walking out on them. I like keeping the pictures around because they document what is, in perfect hindsight, probably the stupidest single thing I have ever done in my life. I don’t exactly regret it, but I certainly wouldn’t do it again. It’s more of a note to self: by the grace of God you got away with this, so don’t push your luck.