Can anyone help me with a program code for a random music player

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
heather_p
 
Posts: 1
Joined: Mon Apr 02, 2012 3:00 am

Can anyone help me with a program code for a random music player

Post by heather_p »

I am fairly new to the whole electronics/circuitry/programming stuff, so please bear with me.

I am making a WoW treasure chest & I want it to play one random song/audio track from the game each time it's opened & then stop until the switch is pressed again. I haven't bought any of the electrical components yet because I want to make sure it's possible for me to actually do this before I spend money on something that might not work.


I have seen this tutorial: http://www.ladyada.net/make/pumpkin/pumpkin.html & would like to do something similar (minus the LEDs) only instead of a motion sensor, I want an actual switch (probably a lever switch) that triggers the audio. I can easily follow the tutorial for putting the device together, my problem is I know nothing about code. Where can I learn how to write a program to make the Arduino/Wave Shield do what I want it to do? I've looked through the tutorials on this site but found it to be a little confusing so any help would be greatly appreciated. Thanks.

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

Re: Can anyone help me with a program code for a random music player

Post by adafruit_support_bill »

The best way to start is to find an example that comes close to what you want and modify it from there. You could take one of the '6-button' examples and wire it up with just one button. Then add in the randomizing code from the Halloween pumpkin project. If you get stuck anywhere, post here on the forums and we'll walk you through it. :D

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Can anyone help me with a program code for a random music player

Post by adafruit_support_mike »

First off, welcome to electronics and coding.

The best way to learn really is to start with circuits and code someone has already tested, get those working, then play around with things to see how they change. There are several important skills you learn from saying, "okay, I know this *should* work, so what's going wrong?"

One point of ettiquette (just so you don't get burned by it) is to expect answers about as specific as the questions you ask. That's mostly an offshoot of the design process, both for hardware and code. For any specific answer to make sense, you have to nail down a bunch of basic assumptions, and it's frustrating on both sides to give/get a specific answer whose background assumptions don't fit what you're trying to do.

The good news is that practically no question is "too basic" if you show that you've put some head time of your own into it first. Even the greatest gurus end up saying, "oh geez.. I had the transistor in upside down," once in a while.

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

Return to “General Project help”