インテル ガリレオを使ってみる – シリアル通信をする –

スポンサーリンク

サンプル見たらありました
https://communities.intel.com/docs/DOC-22272の「Samples of how to run Linux Commands via IDE」をダウンロードし展開するとあります

サンプル中の”Linux_Serial.ino””が標準で付いているセンサで気温を測定するArduinoスケッチ(インテル ガリレオで電子工作をするときのプログラム)のようです

中身は

/*
This example shows how to print text to the 
Galileo's serial ports using Linux system calls.

Example code by Erik Nyquist 2013;
erik.nyquist@intel.com

I do not hold any rights over these 
code examples, and you may do with 
them what you wish
*/
void setup() {
  
  Serial.begin(115200);

}

void loop() {
  
  system("echo \"hello, world!\" > /dev/ttyGS0"); //Serial (IDE Serial Monitor)
  system("echo \"hello, world!\" > /dev/ttyS0");  //Serial1 (Arduino header UART)
  delay(500);
}

上のプログラムを実行すると、インテル ガリレオでシリアル通信ができるかと思います(^O^)

中に
・Serial (IDE Serial Monitor)
・Serial1 (Arduino header UART)
とコメントがあるので、たぶんガリレオ本体のシリアルと、ガリレオ内Arduino部分のシリアルの両方が使えるみたいです