Created
May 27, 2021 16:01
-
-
Save dj1711572002/efb4a649689ded10d55478acea58e75c to your computer and use it in GitHub Desktop.
M5Atom lite UART PIN TEST bokan
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_-Seria1_COM5.ino | |
//#include <M5StickC.h> | |
#include <M5Atom.h> | |
int i; | |
uint8_t outbyte,inbyte; | |
void setup() { | |
M5.begin(); | |
Serial1.begin(115200, SERIAL_8N1, 33, 32); // RX0 TX26 EXT_IO | |
//Serial2.begin(115200, SERIAL_8N1, 26, 25);// RX33 TX32 Grove | |
} | |
void loop() { | |
i++; | |
outbyte=i%256;//uint8_1 0-255 | |
//子機へ送信 | |
Serial1.write(outbyte); | |
Serial.printf("SEND:outbyte=%d\n\r",outbyte); | |
//delay(10); | |
//子機から返信を受信する | |
if (Serial1.available()) { | |
inbyte = Serial1.read(); | |
Serial.print("RCV:inbyte="); | |
Serial.println(inbyte); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment