Im sending two integers from one mega to another, both on Serial3.
Im formatting the outgoing message like this
char ToSend[22];
sprintf_P(ToSend, (PGM_P)F("%04d, %04d, %02d"), THRO_VAL, RUDD_VAL, '\n');
Serial.println (ToSend);
Serial3.write (ToSend);
The data is going out. I put the oscilloscope on the TX of the sender and RX of the receiver. I see data.
on the receiving Arduino I have the basic serial event code.
String inputString = "test"; // a String to hold incoming data
bool stringComplete = false; // whether the string is complete
void setup() {
// initialize serial:
Serial.begin(115200);
Serial3.begin(115200);
// reserve 200 bytes for the inputString:
inputString.reserve(200);
Serial.println(inputString);
}
void loop() {
// print the string when a newline arrives:
if (stringComplete) {
Serial.println(inputString);
// clear the string:
inputString = "";
stringComplete = false;
}
}
/*
SerialEvent occurs whenever a new data comes in the hardware serial RX. This
routine is run between each time loop() runs, so using delay inside loop can
delay response. Multiple bytes of data may be available.
*/
void serialEvent() {
while (Serial3.available()) {
// get the new byte:
char inChar = (char)Serial.read();
// add it to the inputString:
inputString += inChar;
// if the incoming character is a newline, set a flag so the main loop can
// do something about it:
if (inChar == '\n') {
stringComplete = true;
}
}
}
I am not receiving anything
Please help
Mitch