Skip to content

Instantly share code, notes, and snippets.

@ISTweak
Created April 4, 2022 08:57
Show Gist options
  • Save ISTweak/4cc4024c0ef1bd3f2014407a5ef1236c to your computer and use it in GitHub Desktop.
Save ISTweak/4cc4024c0ef1bd3f2014407a5ef1236c to your computer and use it in GitHub Desktop.
M5GFXとM5.lcdの色の違い
#include <M5Stack.h>
#include <M5GFX.h>
const unsigned char sampleimg[16 * 16 * 2 + 1] =
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007\340\007"
"\340\007\340\007\340\007\340\007";
#define USE_GFX 1
#ifdef USE_GFX
M5GFX display;
LGFX_Sprite spicon(&display);
#else
M5Stack display;
TFT_eSprite spicon(&M5.Lcd);
#endif
void setup() {
display.begin();
spicon.createSprite(16, 16);
spicon.pushImage(0, 0, 16, 16, (uint16_t*)sampleimg);
spicon.pushSprite(144, 110);
}
void loop() {
// put your main code here, to run repeatedly:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment