One more thing.
int data = Serial.read() -'5';
only reads a single byte of data. What if the first sketch sends a value like 42 (two bytes)? Or 120 (three bytes)?
Edit: And what does '5' have to do with anything?
One more thing.
int data = Serial.read() -'5';
only reads a single byte of data. What if the first sketch sends a value like 42 (two bytes)? Or 120 (three bytes)?
Edit: And what does '5' have to do with anything?