Created
December 20, 2020 04:58
-
-
Save dj1711572002/50eb9274963f620e9f848462d286da1f to your computer and use it in GitHub Desktop.
M5StickC_Serial1-2Test_Bokan_Jikken4
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_JIkken4-Grove-EXT_-Seria1-2_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, 32, 33);// RX33 TX32 Grove | |
} | |
void loop() { | |
i++; | |
//Serial2からCOM4へ送信 | |
Serial2.write(i); | |
Serial.printf("Grove-Serial2_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