Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dj1711572002/657b2ebaa353e8520a6891ca95aac24c to your computer and use it in GitHub Desktop.
Save dj1711572002/657b2ebaa353e8520a6891ca95aac24c to your computer and use it in GitHub Desktop.
M5StickC_Serial1-2_JIkken1-EXT_-Seria1_COM5.ino
//M5StickC_Serial1-2_JIkken1-EXT_-Seria1_COM5.ino
#include <M5StickC.h>
int i;
void setup() {
M5.begin();
Serial1.begin(115200, SERIAL_8N1, 0, 26); // RX0 TX26 EXT_IO
//Serial2.begin(115200, SERIAL_8N1, 33, 32);// RX33 TX32 Grove
}
void loop() {
i++;
//COm4へ送信
Serial1.write(i);
Serial.printf("Send to COM4:%d\n\r",i%255);
delay(10);
//COM4から返信を受信する
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.print("EXT-Serial1_Receive from COM4:");
Serial.println(inByte);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment