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/b91692470ec3d25ef774c5ee2a6fb4a0 to your computer and use it in GitHub Desktop.
Save dj1711572002/b91692470ec3d25ef774c5ee2a6fb4a0 to your computer and use it in GitHub Desktop.
M5StickC_Serial1-2_JIkken1-EXT_Seial2_COM4
//M5StickC_Serial1-2_JIkken1-EXT_Seial2_COM4.ino
#include <M5StickC.h>
int i;
// COM5=>COM4=>COM5 LoopBack
void setup() {
M5.begin();
Serial2.begin(115200, SERIAL_8N1,0,26); // RX06 TX26 EXT_IO
//Serial2.begin(115200, SERIAL_8N1, 32, 33);// RX32 TX33 Grove
}
void loop() {
//COM5から受信する
if (Serial2.available()) {
int inByte = Serial2.read();
Serial.print("EXT-Serial2_Receive from COM5:");
Serial.println(inByte);
//COM5へ返信
Serial2.write(inByte);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment