using rmp3 rogue robotics player + photocell

Hi I just purchased an rmp3 player from Rogue Robotics. The project is for a client who wants to control mp3 volume level via a photocell. Pretty straightforward. I soldered the shield and will start work tomorrow. I own an UNO board and using Arduino 022 software. My questions are: Can I attach the sensor to analog input 0 on board with rmp3 shield? Can I then plug in mapped analogRead data ie map(300, 850, 0, 254) to the setvolume function to control line level out? Thanks and it seems to be a nice addition, although I haven't gotten it working yet. -M

Can I attach the sensor to analog input 0 on board with rmp3 shield?

Yes

Can I then plug in mapped analogRead data ie map(300, 850, 0, 254) to the setvolume function to control line level out?

Yes but you’d normally want to use a logarithmic function or else only the top values from the sensor will affect the volume. You probably also want to look into the constrain function for the values from the sensor.

Mowcius

I agree. Yes, I think i will map/constrain sensor data to say 0-9. That stream will be used to call up indexes in an array that will be of a log value. YEah, cool mate. I'll update on progress...

Only 10 levels?

There is the log functions are declared in math.h as log10(value) and log(value) for base 10 and natural log respectively. Not sure if log10(value) works though - have a search around.

Should be simple enough to do - I look forward to hearing how it goes.

Regarding the pin connections, the rMP3 only requires connections to 5V, GND, Digital6 & Digital7 - you can use any of the other pins for anything else you like.

Functionality works fine, but I am getting clicks and pops using rmp3.setvolume (I tried rmp3.fade and not a smooth transition lol). Any suggestions for how to change volume levels on the fly w/ arduino library and not get artifacts? Thanks, -M

What type of file are you using at what bitrate etc?

I have not personally had any issues with fading volume noises. Plugs in his rMP3