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: fillCenterSquare の挙動がおかしい

0
Last updated at Posted at 2022-06-09
draw_square.ino
// ---------------------------------------------------------------
//	draw_square.ino
//
//						Jun/09/2022
// ---------------------------------------------------------------
#include <M5EPD.h>

M5EPD_Canvas canvas(&M5.EPD);

// ---------------------------------------------------------------
void setup() {
  // put your setup code here, to run once:
	M5.begin();
	M5.EPD.SetRotation(90);
	M5.TP.SetRotation(90);
	M5.EPD.Clear(true);
	canvas.createCanvas(540, 960);
	canvas.setTextSize(5);

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

	canvas.fillRect(200, 200, 50, 30, WHITE);
	canvas.drawRect(200, 300, 50, 30, WHITE);

	canvas.fillRoundRect(300, 200, 50, 30, 10, WHITE);
	canvas.drawRoundRect(300, 300, 50, 30, 10, WHITE);

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

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

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

// ---------------------------------------------------------------
void loop() {
  // put your main code here, to run repeatedly:

}

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

Arduino IDE
image.png

実行結果
IMG_20220609_125723.jpg

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?