Hi trying to connect two Arduino's - Mega & Uno in serial communication. Pressing KEY"s Connected with UNO and UNO as serial code sender and Mega as receiver and transmitter to pc . testText() it's call function it's having display code line . without testText () call function serial communication working properly but with testText() PC receiving slowly . How to enable the Interrupt activation when there is serial data Arrived - Serial Interrupt and how to make sure receiver not missing any receiving codes from receiver ```
void loop(void) {
testText();
if (Serial2.available()) {
c = Serial2.read();
Serial.print(c);
the Uno Serial port is already being used by the PC.
you could try powering the Uno independently (USB charger) and monitoring the activity on the Mega connected to the PC
--------------------------------------------------------------------------------
---------- Mega
void
loop (void)
{
if (Serial.available () // from PC
Serial2.print (Serial.read());
if (Serial2.available () // from UNO
Serial.print (Serial2.read());
}
--------------------------------------------------------------------------------
---------- UNO
void
loop (void)
{
if (Serial.available ()
Serial.print (Serial.read()); // echo back
}
Split testText() into multiple functions that do simple things quickly so that incoming characters can be processed in between. In general you can print the empty form in one function, called in setup(), and in another function only update the temperatureValue field. Then call the update function whenever the temperature has changed.