M5Paper: canvas をタイマーで切り替えて描画

プログラム

```text:draw_square.ino
// ---------------------------------------------------------------
//	draw_square.ino
//
//						Jun/19/2022
// ---------------------------------------------------------------
#include <M5EPD.h>

M5EPD_Canvas canvas_a(&M5.EPD);
M5EPD_Canvas canvas_b(&M5.EPD);
M5EPD_Canvas canvas_c(&M5.EPD);

// ---------------------------------------------------------------
void prepare_canvas_a_proc()
{
	canvas_a.createCanvas(540, 960);
	canvas_a.setTextSize(5);
	canvas_a.drawString("canvas A",200,100);

	canvas_a.fillCenterSquare(100, 100, 50, WHITE);
	canvas_a.fillCenterSquare(200, 100, 40, WHITE);
	canvas_a.fillCenterSquare(300, 100, 30, WHITE);

	canvas_a.drawRoundRect(300, 300, 50, 30, 10, WHITE);

	canvas_a.fillCircle(200, 400, 30, WHITE);
	canvas_a.drawCircle(200, 500, 30, WHITE);

	canvas_a.fillCircle(300, 400, 15, WHITE);
	canvas_a.drawCircle(300, 500, 15, WHITE);

	canvas_a.fillEllipse(200, 600, 30,15, WHITE);
	canvas_a.drawEllipse(200, 700, 30, 15, WHITE);
	
	canvas_a.fillTriangle(200, 800, 300,800, 250,750, WHITE);
	canvas_a.drawTriangle(200, 900, 300,900, 250,850, WHITE);
	
	canvas_a.fillTriangle(400, 800, 500,800, 450,775, WHITE);
	canvas_a.drawTriangle(400, 900, 500,900, 450,875, WHITE);
}

// ---------------------------------------------------------------
void prepare_canvas_b_proc()
{
	canvas_b.createCanvas(540, 960);
	canvas_b.setTextSize(5);
	canvas_b.drawString("canvas B",200,150);

	canvas_b.fillCircle(100, 300, 50, WHITE);
	canvas_b.fillCircle(250, 300, 40, WHITE);
	canvas_b.fillCircle(400, 300, 30, WHITE);

}

// ---------------------------------------------------------------
void prepare_canvas_c_proc()
{
	canvas_c.createCanvas(540, 960);
	canvas_c.setTextSize(5);
	canvas_c.drawString("canvas C",200,200);

  
	canvas_c.fillTriangle(100, 800, 300,800, 200,700, WHITE);
	canvas_c.drawTriangle(100, 900, 300,900, 200,800, WHITE);
  
	canvas_c.fillTriangle(300, 800, 500,800, 400,700, WHITE);
	canvas_c.drawTriangle(300, 900, 500,900, 400,800, WHITE);
}

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

	prepare_canvas_a_proc();
	prepare_canvas_b_proc();
	prepare_canvas_c_proc();

//	canvas_a.pushCanvas(0,0,UPDATE_MODE_DU4);
}

// ---------------------------------------------------------------
void loop()
{
	const int delt = 3000;

	canvas_a.pushCanvas(0,0,UPDATE_MODE_GLD16);
	delay(delt);
	canvas_b.pushCanvas(0,0,UPDATE_MODE_GLD16);
	delay(delt);
	canvas_c.pushCanvas(0,0,UPDATE_MODE_GLD16);
	delay(delt);
}

// ---------------------------------------------------------------
```

Arduino IDE
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/179446/8b7f0d70-a027-ffd8-8256-cef71f71947b.png)

実行結果

![IMG_20220619_141736.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/179446/2e9fa04d-85e9-ef5a-f20f-410aaa35ba98.jpeg)


![IMG_20220619_141810.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/179446/d6e11315-1ccf-b6cb-b96a-d4f7149a32d8.jpeg)

![IMG_20220619_141849.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/179446/f66c0316-5da1-2386-3479-aabae1c196c6.jpeg)