M5 Stack Core 2로 그리기

1784 단어 M5stackCore2
다음 드로잉을 그립니다.

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);
}

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

좋은 웹페이지 즐겨찾기