Newer
Older
m5stickcplus / src / serial01.ino
@Motoki Motoki 22 days ago 524 bytes Plus2
#include <Arduino.h>
#include <M5Unified.h>

int num = 0;
void setup() {
  auto cfg = M5.config();
  cfg.serial_baudrate = 115200;  // Serial通信速度(ボーレート)をbpsで設定
  M5.begin(cfg);
  M5.Display.setRotation(0); //縦(M5が読める向き)
  M5.Display.setFont(&fonts::lgfxJapanGothic_16);
  M5.Display.println("serial01");
  M5.Display.setTextScroll(true);
}
void loop() {
  M5.Display.printf("%d \n" , num);
  Serial.printf("%d \n" , num);
  num++;
  M5.delay(1000); // 1秒待つ
}