Hello, im relatively new to the Arduino platform but have been working with the basic stamp microcontroller for years. In my previous project I made a robot exclusively using the bs2 that had voice recognition (vrbot) and text to speech (emic TTS Module). Now ive started a similar project using both the Arduino and BS2 and im lost. First off, I purchased and assembled the wave shield, tested it, and it works fine, next I used my bs2 microcontroller and programmed the vrbot to work on there . I was planning on running a serial line that would send an ASCII letter to the arduino for every phrase I said to the bs2. so far Im able to send the letter A when I say Robot-Move-Foreward and B when I say Robot-Move-Backward. and the arduino reads them fine. The part Im stuck on is getting the arduino to play an audio file accordingly when it receives a letter from the bs2. Ive seen the example code from Ladyada.com that plays audio clips from serial commands but that didnt make much sense. I know Im asking alot but could someone show me how 2 get the audio files to play based on the incoming serial ASCII letters? Thank you in advance ;D
Arduino code:
#include <NewSoftSerial.h>
NewSoftSerial BS2(0, 255); // receive only
void setup() {
Serial.begin(9600);
BS2.begin(9600);
}
void loop() {
if(BS2.available() > 0) {
bs2data = BS2.read();
Serial.print("Received from BS2: ");
Serial.println(bs2data);
if (bs2data == 'A')
{
Serial.println("ROBOT MOVE FOREWARD");
}
if (bs2data == 'B')
{
Serial.println("ROBOT MOVE BACKWARD");
}
}
}