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

こちらのページを参考にしました。
EPD Driver

IMG_20220602_160814.jpg

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

M5EPD_Canvas canvas(&M5.EPD);

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

    M5.RTC.begin();
    canvas.createCanvas(960, 540);
    canvas.setTextSize(5);
    int xx = 100;
    int yy = 30;
    canvas.drawString("Draw Geometries", xx, yy);
    
    canvas.drawString("Jun/2/2022 PM 16:00", xx+100, yy+400);

  int yy1 = 150;
  int rr = 60;
  for (int it=0; it<6; it++)
	{
	int xx1 = 100 + it * 150;
	canvas.fillCircle(xx1, yy1, rr, WHITE);
	int rr_s = it * 10;
	canvas.fillCircle(xx1, yy1, rr_s, BLACK);
	}

int yy2 = 250;
int ll = rr * 2;
for (int it=0; it<6; it++)
	{
	int xx2 = 50 + it * 150;
	canvas.fillRect (xx2,yy2,ll,ll,WHITE);
	int xcenter = xx2 + rr;
	int ycenter = yy2 + rr;
	int ll2 = it * 20;
	int xpos = xcenter - ll2 / 2;
	int ypos = ycenter - ll2 / 2;
	canvas.fillRect (xpos,ypos,ll2,ll2,BLACK);
	}

    canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
}

// ---------------------------------------------------------------
void loop(){
}

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

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?