Serial communication between Arduino Uno and Galileo Gen2

I have a Arduino Uno connected to this TFT display and I’m trying to send text data from Galileo’s serial port to Arduino’s serial port.

Pins 10 and 11 of Galileo are connected to pins RX, TX of Arduino.

This is the sketch that is running on theArduino Uno:

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
 
//Definicao de cores
#define BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0
#define WHITE           0xFFFF
 
//CS, CD, WR, RD, RESET
Adafruit_TFTLCD tft(A3, A2, A1, A0, A4);
 
void setup(void) 
{
  Serial.begin(9600);
  tft.reset();
  delay(500);
  tft.begin(0x9341);
  
  tft.fillScreen(WHITE);
  tft.setTextColor(BLACK);
  tft.setTextSize(3);
  tft.setCursor(0, 20);
  
}
 
void loop()
{
 
  tft.fillScreen(BLACK);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.setCursor(0, 20);
  tft.println(Serial.readString());
  delay(1000);
  
}

}

If I use the Serial Monitor to send data, this works just fine, but I want it to print whatever data the Galileo is sending.

And this is the one running on the Galileo Gen2:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
Serial.write("Testing...");
}

When I open the Serial Monitor it shows just fine the “Testing…” string, but Arduino never receives it.

Your loop() on the Galileo will repeat very fast and will probably overhwelm its ability to send and the Uno's ability to receive. Put in a delay(1000) for testing.

Added to that your Uno code only checks for stuff once per second.

IMHO you need a very different approach on the Uno. Have a look at the examples in Serial Input Basics - simple reliable ways to receive data without blocking and without needing any delay()s.

You may also make things much easier for yourself if you use SoftwareSerial to create an extra serial port on the Uno to receive data from the Galileo. That will allow you to print to the Serial Monitor for debugging. Then convert to the LCD when you have the comms with the Galileo working

...R

Your reply helped me a lot! Thank you! turns out it was also a wiring problem. I fixed the incorrect wires, added the delay to my code, and it worked! Thank you very much again.