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/efb4a649689ded10d55478acea58e75c to your computer and use it in GitHub Desktop.
Save dj1711572002/efb4a649689ded10d55478acea58e75c to your computer and use it in GitHub Desktop.
M5Atom lite UART PIN TEST bokan
//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