Serial port programming in Galileo

1.1k views Asked by At

I am new to Intel Galileo. I am trying simple things. How do I use serial TX(Digital pin 1) and serial RX(Digital pin 0) for communicating with other UART devices ? Which serial port is this UART ? I tried to connect it by configuring it as uart 0/1/2 but did not work.

void setup() {    
  Serial1.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial1.println("Hello Galileo");
  delay(300);
}
2

There are 2 answers

2
user5035404 On

I have never used the Galileo but I was not aware that it had more than 1 serial port. So basing my thinking on the UNO as well as the MEGA, pin 0 and 1 should not be Serial1 but just Serial, meaning that if you connect the TX pin to the RX pin of another device and then, as you posted above, run your code with Serial.begin(9600); and Serial.println.... instead of Serial1.... it should work as far as I know... Also, I sometimes use Serial.Write but I am unsure of what the difference is. I normally would not answer a question I don't know the exact solution to but as there are no answers yet I thought I would give it a try.

0
Ron On

I'm using a Gen2 and the latest build of Windows IoT (9600.16384.x86fre.winblue_rtm_iotbuild.150309-0310_galileo_v2). In that build, Serial is the correct object for COM1 on pins D0 and D1 and I've used it successfully.

Serial1 is supposed to be COM2 on D2 and D3, but I get an error when I try to open it. I'm still working on that.