Pages: [1]   Go Down
Author Topic: Have trouble about my arduino with Mp3 shield control by potentiometer  (Read 711 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

WE have  link a Mp3 shield with our arduino Uno and put a potentiometer on to analog A2 and hope it can swich between different tracks.
The number jump from 0-1200 @ the  potentiometer without a problem.
But when we load up the coldes and swhich the whole thing on. the mp3 tracks came up  very lag and with lots noice. And it does not change track while we turning the potentiometer.  Some times it change after a 20sec delay but the music is so laggy and noicey. compare with when we only use a normal digital swich to triger the track. can anyone help me out !
 ... 
 thanks
This is the codes we use
Code:
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>

SdFat sd;
SFEMP3Shield MP3player;

int potPin = 2;    // select the input pin for the potentiometer
int val = 0;       // variable to store the value coming from the sensor




void setup() {

  Serial.begin(9600);
  pinMode(potPin, INPUT);  // declare the ledPin as an OUTPUT

  sd.begin(SD_SEL, SPI_HALF_SPEED);


}

//do something else now
void loop() {
  
  val = analogRead(potPin);
  Serial.println(val);
  MP3player.begin();
  
  if(val > 500){
    MP3player.playTrack(1);
  }
  if(val < 500){
  MP3player.playTrack(2);
  }
« Last Edit: October 21, 2013, 05:07:35 am by akiha » Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19350
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please use code tags.

Read this before posting a programming question

How to use this forum

Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for the notice.

Sadly noone can give me a bit of tips ; ;?
Logged

Pages: [1]   Go Up
Jump to: