I'm having some trouble figuring out why I'm not receiving any data on my Mega 2560. I have a lab that's tasked me to use UART communication between a UNO and Mega 2560. I got the Mega to send a character to the UNO, then the UNO prints it to the Serial Monitor, but when I try to send an acknowledgment char back to the Mega from the UNO it doesn't send.
Does anyone know what I'm doing wrong?
Edit;
Thanks for the help everyone! I'll remember not to use SoftwareSerial on UART pins
Further, Pins 14 and 15 are (by default) TX/RX for serial3. (your sketch will work with no hardware change if you ommit softwareserial and add a "Serial3.begin(...)").
Did you cross the wiring between uno and mega? (tx->rx, rx->tx)?
It should not be necessary to use the listen() function when there is only one softwareserial in use.
Only reading the software serial if the character received is the acknowledgement character is not a good technique, if for some reason you receive an incorrect character that will never get read and you will never see any subsequent acknowledgments.
thanks everyone! I guess i was confused about how/when to use SoftwareSerial.
So if i;m understanding this correctly, SoftwareSerial is used for pins that ARE NOT UART pins. If there are already provided UART pins, just use SerialX? From what I read Serial (no number) is used to communicate with the virtual communication between PC and Arduino. If I connected an external device to the Serial (no number), I would NOT be able to send data to the PC from Arduino?