General

DFduino Player Module - HELP

userHead Account cancelled 2013-06-19 05:20:25 5006 Views1 Replies
Ok so im using the following code for my player module on the Arduino UNO v3:
Code: Select all
#include <SoftwareSerial.h>

SoftwareSerial mp3player = SoftwareSerial(7,8); //RX, TX

void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(0, INPUT);
  pinMode(1, OUTPUT);
  digitalWrite(0, HIGH);
  digitalWrite(1, HIGH);
  // set the data rate for the SoftwareSerial port
  Serial.begin(19200);
  mp3player.begin(19200);
  mp3player.println("\\:v 210\r\n");
  Serial.print("i got: ");
  Serial.println(mp3player.read());
  mp3player.println("\\5\r\n");
  Serial.print("i got: ");
  Serial.println(mp3player.read());
}
void loop()
{
}
EDIT: The problem is the serial monitor is giving me numbers instead of "file not found" or "Play ok"
2013-06-27 01:05:19 note that you are reading char by char
http://arduino.cc/en/Reference/SoftwareSerialRead

if you want to read the whole string, you could to create a loop that will read all the data on the serial buffer and then print it out. otherwise, you are printing only the first char,

Also, make sure to convert it, if you are reading decimals or chars and so on..
userHeadPic Jose