Created
December 20, 2020 05:37
-
-
Save dj1711572002/b91692470ec3d25ef774c5ee2a6fb4a0 to your computer and use it in GitHub Desktop.
M5StickC_Serial1-2_JIkken1-EXT_Seial2_COM4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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