Skip to content

Instantly share code, notes, and snippets.

@hollyhockberry
Created September 26, 2021 11:02
Show Gist options
  • Save hollyhockberry/91f07c4abe2b6ddf69d13f5401f0041f to your computer and use it in GitHub Desktop.
Save hollyhockberry/91f07c4abe2b6ddf69d13f5401f0041f to your computer and use it in GitHub Desktop.
M5Paper: draw bitmap file with M5GFX
#include <M5EPD.h>
#include <M5GFX.h>
// SDカードに以下のファイルを用意
// /inaba.bmp 540x540 24bit
// /inaba2.bmp 270x270 24bit
void setup() {
M5.begin();
M5GFX display;
display.begin();
display.invertDisplay(false);
display.clear(TFT_WHITE);
display.drawBmpFile(SD, "/inaba.bmp", 0, 0);
M5Canvas canvas(&display);
canvas.setPsram(true);
canvas.createSprite(300, 300);
canvas.clear(TFT_WHITE);
canvas.drawBmpFile(SD, "/inaba2.bmp");
canvas.pushSprite(0, 540);
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment