1
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 1 year has passed since last update.

M5Stack Core2 で描画

Last updated at Posted at 2021-08-30

次のような描画をします。
IMG_20210830_200128.jpg

display01/display01.ino
// ---------------------------------------------------------------
/*
	display01.ino

					Aug/30/2021
*/
// ---------------------------------------------------------------
#include <M5Core2.h>

// ---------------------------------------------------------------
void setup() {
	M5.begin();
	M5.Lcd.setBrightness(32);
	M5.Lcd.fillScreen(WHITE);
	delay(200);

	draw_five_circles();
	delay(500);
}						 


// ---------------------------------------------------------------
void draw_five_circles()
{
	int tt = 200;
	draw_circle_proc(60,120,BLUE);
	delay(tt);
	draw_circle_proc(160,120,BLACK);
	delay(tt);
	draw_circle_proc(260,120,RED);
	delay(tt);
	draw_circle_proc(110,170,YELLOW);
	delay(tt);
	draw_circle_proc(210,170,GREEN);
	delay(tt);
}

// ---------------------------------------------------------------
void draw_circle_proc(int xpos,int ypos,uint16_t color)
{
	for (int it=0; it< 10; it++)
		{
		int rr = 41 + it;
		M5.Lcd.drawCircle(xpos, ypos, rr, color);
		}
}

// ---------------------------------------------------------------
void loop()
{
	M5.Lcd.setTextColor(MAGENTA);
	M5.Lcd.setTextSize(5);
	M5.Lcd.clear(WHITE);
	draw_five_circles();
	M5.Lcd.drawString("TOKYO 2020",15,10,1);
	delay(3000);
	M5.Lcd.clear(WHITE);
	draw_five_circles();
	M5.Lcd.drawString("PARIS 2024",15,10,1);
	delay(3000);
}

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

Arduino 1.8.19 で表示した様子
image.png

1
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
1
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?