1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

M5Stack Core2 で シリアル通信

Last updated at Posted at 2021-08-30

M5Stack Core2 でシリアル通信を行う方法です。

注意すべきは

シリアルコンソールが使えない。
送受信プログラムを用意する必要がある。
ボーレートは、115200

serial/serial.ino
// ---------------------------------------------------------------
/*
	serial.ino

						Aug/30/2021
*/
// ---------------------------------------------------------------
#include <M5Core2.h>

int icount = 0;
// ---------------------------------------------------------------
void setup()
{
	M5.begin();
    M5.Lcd.setTextSize(3);
	M5.Lcd.println("Good Morning");
}

// ---------------------------------------------------------------
void loop()
{
	Serial.println("icount = " + String(icount));

	M5.Lcd.setCursor(5,30);
	M5.Lcd.println("icount = " + String(icount));
	delay(1000);
	icount++;
}

// ---------------------------------------------------------------

arduino_sep23.png

受信した様子

$ cu -s 115200 -l /dev/ttyACM0
Connected.
icount = 2
icount = 3
icount = 4
icount = 5
icount = 6
icount = 7
icount = 8
icount = 9
icount = 10
icount = 11
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?