I’m trying to get a BMP to display on WIO using pushImage(). The image is a solid 8x8 red square. It does not display as red, but seems to be blue or another color if you call swapBytes (). Image was designed using Microsoft paint and converted to an Arduino array using Image2CPP. Platform is VSCode using PlatformIO plugin. Here is the code:
#include <Arduino.h>
#include “TFT_eSPI.h” // WIO display stuff
// ‘red’, 8x8px
const uint16_t myredred [] = {
0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe208, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108,
0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108,
0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108,
0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108, 0xe108
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 80)
const int myredallArray_LEN = 1;
const uint16_t* myredallArray[1] = {
myredred
};
TFT_eSPI tft; // WIO display
void setup() {
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
tft.setSwapBytes(true);
tft.pushImage (8, 8, 8, 8, myredred);
}
void loop() { }