Created
December 20, 2020 05:40
M5StickC_Serial1-2_JIkken2_COM5
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_JIkken2_COM5.ino | |
#include <M5StickC.h> | |
int i; | |
void setup() { | |
M5.begin(); | |
Serial.begin(115200); | |
Serial1.begin(115200, SERIAL_8N1, 26, 0); // RX26 TX0 EXT_IO | |
Serial2.begin(115200, SERIAL_8N1, 33, 32);// RX33 TX32 Grove | |
} | |
void loop() { | |
i++; | |
//COm4へ送信 | |
Serial2.write(i); | |
delay(10); | |
//COM4から返信をSerial1で受信する | |
if (Serial1.available()) { | |
// Serial2(Grove) to Serial(PC) | |
int inByte = Serial1.read(); | |
Serial.print("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