0
0

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 3 years have passed since last update.

M5Paper で 文字を点滅

0
Last updated at Posted at 2022-06-02

こちらのプログラムを改造して文字を点滅させてみました。
M5Paper で Hello World

hello_blink.ino
// ---------------------------------------------------------------
//	hello_blink.ino
//
//					Jun/02/2022
// ---------------------------------------------------------------
#include <M5EPD.h>

M5EPD_Canvas canvas(&M5.EPD);

  String ssx[] = {"Hello World","Good Morning","Good Afternoon",
    "Good Evening","Good Night"};

// ---------------------------------------------------------------
void setup(){
    M5.begin();
    M5.EPD.Clear(true);

    M5.RTC.begin();
    canvas.createCanvas(960, 540);
    canvas.setTextSize(5);
    int xx = 100;
    int yy_start = 30;

  for (int it=0; it< 5; it++)
  {
    int yy = yy_start + it * 80;
    canvas.drawString(ssx[it], xx, yy);
  }
 
    canvas.drawString("Jun/2/2022 PM 14:27", xx+100, yy_start+400);
    canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
}

// ---------------------------------------------------------------
void loop(){
    int xx = 100;
    int yy_start = 30;

  for (int it=0; it< 5; it++)
  {
    int yy = yy_start + it * 80;
    canvas.drawString("               ", xx, yy);
    canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
	delay (1000);
    canvas.drawString(ssx[it], xx, yy);
    canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
	delay (1000);
  }

}
// ---------------------------------------------------------------

Arduino IDE

image.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?