i dont see any thing wrong with the code but all im getting is
Bad character received when index = and some boxes in there were the data is supposed to be .I dont know if its my transmitter or the receiver. For the transmiter i think that i am sending the info all at once would the recever keep that in a buffer untill its ready or is it flushed.
This is the receivers with the added code from above
#include <SoftwareSerial.h>
//Radio receiver
#define rxPin 2
#define txPin 3
char good[] = {"abcdefghijklmnopqrstuvwxyz"};
byte index;
SoftwareSerial rfSerial = SoftwareSerial(rxPin, txPin);
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
rfSerial.begin(2400);
Serial.begin(2400);
}
void loop() {
index = 0;
while(Serial.available() && index < 26)
{
char aChar = Serial.read();
if(aChar != good[index])
{
Serial.flush(); // Dump the rest of the pending data
// Print out where the mismatch occurred
Serial.print("Bad character received when index = ");
Serial.println(index, DEC);
// Print out what the mismatch is
Serial.print("Received ");
Serial.print(aChar);
Serial.print(" instead of ");
Serial.println(good[index]);
// Get out of the while loop
break;
}
index++; // Advance to the next good character
}
}
this is may altered transmitting end
#include <SoftwareSerial.h>
//Radio Transmitter
#define rxPin 2
#define txPin 3
SoftwareSerial rfSerial = SoftwareSerial(rxPin, txPin);
char good[] = {"abcdefghijklmnopqrstuvwxyz"};
byte index;
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
rfSerial.begin(2400);
Serial.begin(2400);
}
void loop() {
index = 0;
Serial.print("abcdefghijklmnopqrstuvwxyz");
rfSerial.println("abcdefghijklmnopqrstuvwxyz");
index++; //add 1 each time it loops
delay(10);
}