Hi all.
first post here so please go easy on me
I'm new to Arduinos, although I work in I.T. (networking) so hopefully I'll be able to pick it up as I go along.
I tried including the code in my post, but it said I'd exceeded my character count, so I've put the code in text files in my dropbox folder.
I'm building a full size Aluminium R2D2, and I'm going to be using an Arduino Uno to control the led's for the charge bay indicator (the bit in the Empire Strikes back when Luke plugs a lead into R2 to recharge him) and also to play the sounds.
To make the sounds, I'm using a Vmusic2 module. Currently, I just have a load of samples on the Vmusic2 module.
The led's are driven by a board usin a MAX72XX chip. this chip also monitors the voltage of the battery, so it will light up a green/amber/red LED to represent the battery charge status.
I got some code off the R2 forum, which seems to work fine (I haven't got the MAX72XX board made up yet) in that it gives no errors when compiled, uploads ok, and flashes the on board LED.
The code I've used for that, is here.
https://dl.dropbox.com/u/24096831/CBI_SKETCH.rtf
The code for the Vmusic2 module which I found on a search through this forum a while back is here.
https://dl.dropbox.com/u/24096831/Vmusic2_SKETCH.rtf
I changed the code slightly to make the Vmusic2 module play all the samples repeatedly and randomly.
My ultimate aim is that I want the LED board to work, and also the Vmusic2 module to play random samples, ideally at a random interval between 5 and 10 seconds apart, but I don't know whether that's possible as it appears a delay of 5000ms would also delay the code update that the Arduino sends to the LED board.
Anyway, for the time being I'd be happy to just get the two working together with no delay. I can always add empty space to the MP3's I'm using if need be.
So, I've tried to combine the two sketches together to get the code that will do both, but it doesn't seem to be working.
It compiles ok, and the LED side of things work.. but it doesn't seem to be sending the command to the Vmusic2 module.
all I actually need to send to the Vmusic2 module is the VRR command to tell it to play all the samples randomly, and in a loop. I think the VRR command does that. once it executes, that should be it.
But, I just can't get that to happen.
I've tried putting the Vmusic2 sketch code in the void setup and void loop parts of the code, but it still doesn't work.
The Vmusic2 sketch on it's own works, so I know all the pinouts are OK.. Just doesn't work in a combined code form.
This is the combined code I'm currently using.
https://dl.dropbox.com/u/24096831/Combined_Sketch.rtf
It validates ok, and uploads ok. Just doesn't play the sounds.
The Vmusic module comes on power wise, just doesn't play.
The pinouts I'm using are
Arduino Vmusic
5v 5v
GND GND
GND CTS
TX>1 RX
As I say, I'm new to Arduinos so I'm not where I'm going wrong really.
It appears the MAX chip is 19200 and the Vmusic2 is 9600, so I've tried to combine the code including changing from 19200 to 9600 and vice versa. that may be wrong though.
The serial monitor does show the correct output for the LED code though, showing which LED it will light based on the battery voltage.
It really does just appear to be the Vmsusic part that doesn't want to happen. If I can just send that VRR command to it, I'll be happy.
Sorry this is a long one, but I've tried to include as much as I can.
Cheers,
Glyn.