Newer
Older
M5StickCPlus_FactoryTest2022 / SampleSrc / lcd01.ino
#include <M5StickCPlus.h>

void setup() {
  M5.begin(115200);
  M5.Lcd.setRotation(3);
  M5.Lcd.fillRect(0, 0, 240, 135, RED); 
  //M5StickCPlusの画面サイズは、240 x 135

  M5.Lcd.fillRect(10, 10, 220, 115, ORANGE);
  M5.Lcd.fillRect(20, 20, 200, 95, YELLOW);
  M5.Lcd.fillRect(30, 30, 180, 75, GREENYELLOW);
  M5.Lcd.fillRect(40, 40, 160, 55, CYAN);
  M5.Lcd.fillRect(50, 50, 140, 35, BLUE);
  M5.Lcd.fillRect(60, 60, 120, 15, MAGENTA);

  M5.Lcd.setTextFont(1); // 8pixel ASCII font
  M5.Lcd.setTextSize(1); // Magnify (x1-7)
  M5.Lcd.setTextColor(WHITE);
  M5.Lcd.setCursor(10,1); M5.Lcd.print("RED");
  M5.Lcd.setTextColor(BLACK);
  M5.Lcd.setCursor(20,11); M5.Lcd.print("ORANGE");
  M5.Lcd.setCursor(30,21); M5.Lcd.print("YELLOW");
  M5.Lcd.setCursor(40,31); M5.Lcd.print("GREENYELLOW");
  M5.Lcd.setCursor(50,41); M5.Lcd.print("CYAN");
  M5.Lcd.setTextColor(WHITE);
  M5.Lcd.setCursor(60,51); M5.Lcd.print("BLUE");
  M5.Lcd.setCursor(70,60,2); M5.Lcd.print("MAGENTA (2)");
  // setCursorの第3引数は、TextFont番号

  M5.Lcd.setTextColor(BLACK);
  M5.Lcd.setCursor(30,90,4); M5.Lcd.print("26pixel ASCII (4)");
}

void loop() {
}