下方API使用RGB565颜色编码格式
#define BLACK       0x0000 /*   0,   0,   0 */
#define NAVY        0x000F /*   0,   0, 128 */
#define DARKGREEN   0x03E0 /*   0, 128,   0 */
#define DARKCYAN    0x03EF /*   0, 128, 128 */
#define MAROON      0x7800 /* 128,   0,   0 */
#define PURPLE      0x780F /* 128,   0, 128 */
#define OLIVE       0x7BE0 /* 128, 128,   0 */
#define LIGHTGREY   0xC618 /* 192, 192, 192 */
#define DARKGREY    0x7BEF /* 128, 128, 128 */
#define BLUE        0x001F /*   0,   0, 255 */
#define GREEN       0x07E0 /*   0, 255,   0 */
#define CYAN        0x07FF /*   0, 255, 255 */
#define RED         0xF800 /* 255,   0,   0 */
#define MAGENTA     0xF81F /* 255,   0, 255 */
#define YELLOW      0xFFE0 /* 255, 255,   0 */
#define WHITE       0xFFFF /* 255, 255, 255 */
#define ORANGE      0xFDA0 /* 255, 180,   0 */
#define GREENYELLOW 0xB7E0 /* 180, 255,   0 */
#define PINK        0xFC9F /* 255, 255,  16 */函数原型:
void fillScreen(uint32_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.fillScreen(BLUE);
}
void loop() {}函数原型:
void setTextColor(uint16_t color, uint16_t backgroundcolor);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.setTextColor(RED, WHITE);
  M5.Lcd.println("Hello, M5Stack world!!");
}
void loop() {
}函数原型:
size_t print(const String &s);功能说明:
在屏幕的当前光标位置开始打印文本
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.print("print text");
}
void loop() {}函数原型:
void setCursor(int16_t x0, int16_t y0);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.setCursor(7, 20);
  M5.Lcd.println("scan done");
  M5.Lcd.setCursor(5, 60);
  M5.Lcd.printf("50 AP");
}
void loop(){}函数原型:
void drawPixel(int16_t x, int16_t y, uint16_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.drawPixel(22, 22, RED);
}
void loop() {}函数原型:
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.drawLine(0, 0, 12, 12, BLUE);
}
void loop() {}函数原型:
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.drawTriangle(22, 22, 69, 98, 51, 22, RED);
}
void loop() {}函数原型:
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.fillTriangle(22, 22, 69, 98, 51, 22, RED);
}
void loop() {}函数原型:
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);功能说明:
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.drawRect(50, 100, 30, 10, BLUE);
}
void loop() {}功能说明:
填充形式的矩形,其左上角坐标为(x,y),宽高分别为 width和 height函数原型:
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.fillRect(50, 100, 20, 10, BLUE);
}
void loop() {}函数原型:
void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);功能说明:
以指定颜色画圆角矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为radius
传入参数:
返回值:
案例程序:
#include <M5StickC.h>
void setup() {
  M5.begin();
  M5.Lcd.fillRoundRect(40, 70, 20, 10, 4, BLUE);
}
void loop() {}