Hello everyone, the project Im working on is interfacing the wave shield with a vrbot connected to a basic stamp with a serial line bridging the arduino ATMega 328 with my bs2. Im very new to the arduino and fear I bitten off more than I can chew.
My current problem is that I cant get the arduino code up and running.
The error message is "bs2data is not declared in this scope" could anyone tell me how to define this? again i apologize for my newb...ness Thank u in advance ;D
#include <avr/pgmspace.h>
#include "util.h"
#include "MediaPlayer.h"
#include <NewSoftSerial.h>
NewSoftSerial BS2 = NewSoftSerial(0, 255); // receive only
void setup() {
NewSoftSerial BS2(0, 255); // receive only
Serial.begin(9600);
BS2.begin(9600);
}
MediaPlayer mediaPlayer; // create only one object, must be global
void loop()
{
if(BS2.available() > 0) {
bs2data = BS2.read();
Serial.print("Received from BS2: ");
Serial.println(bs2data);
blinkLed();
putstring("\nThese files are on the SD card:\n");
mediaPlayer.exploreSDcard(true);
putstring("\nSD card file count = ");
Serial.print(mediaPlayer.exploreSDcard());
if(!mediaPlayer.play("Notexist")) putstring("\nFile not exist"); // result is false
putstring("\nSD card filename of file no. 3 = ");
Serial.print(mediaPlayer.fileName(3)); // now easier
putstring("\nPlay ILSE1.WAV without using stop()");
mediaPlayer.play("ILSE1.WAV");
while (mediaPlayer.isPlaying()) {
putstring(".");
delay(50);
}
if (bs2data == 'A')
{
putstring("\nPlay TWOBIT.WAV");
mediaPlayer.play("TWOBIT.WAV");
delay(2000);
Serial.println("ROBOT MOVE FOREWARD");
}
putstring("\nPlay KREZIP1.WAV");
mediaPlayer.play("KREZIP1.WAV");
delay(2000);
putstring("\nPause");
mediaPlayer.pause();
if(mediaPlayer.onPause()) putstring("\nMediaPlayer on pause");
delay(500);
putstring("\nResume");
mediaPlayer.resume();
delay(2000);
putstring("\nStop");
mediaPlayer.stop();
playComplete("ANOUK1.WAV");
putstring("\nPlay all songs");
for(int i=1; i<=mediaPlayer.exploreSDcard(); i++) playComplete(i);
printAvailableRAM();
}