Hello
I have a problem trying to draw an image on my ST7789 2inch TFT. A square image is draw but it is just filled with random dots.
The bit map was created using Image2cpp and is
const unsigned char lamp [] PROGMEM = {
// 'lamp, 41x52px
0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff,
0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xf0, 0xff, 0xff, 0xff, 0x80,
0xff, 0xc0, 0x0f, 0xff, 0xff, 0x80, 0xff, 0x80, 0x03, 0xff, 0xff, 0x80, 0xff, 0x0f, 0x00, 0x7f,
0xff, 0x80, 0xfe, 0x1f, 0xe0, 0x1f, 0xff, 0x80, 0xfe, 0x3f, 0xfc, 0x0f, 0xff, 0x80, 0xfe, 0x3f,
0xff, 0x03, 0xff, 0x80, 0xfc, 0x3f, 0xff, 0xc1, 0xff, 0x80, 0xfc, 0x7f, 0xff, 0xf0, 0xff, 0x80,
0xfc, 0x7f, 0xff, 0xf8, 0x7f, 0x80, 0xfc, 0x7f, 0xff, 0xfc, 0x3f, 0x80, 0xf8, 0x7f, 0xff, 0xfe,
0x1f, 0x80, 0xf8, 0x7f, 0xff, 0xff, 0x1f, 0x80, 0xf8, 0x7f, 0xff, 0xff, 0x8f, 0x80, 0xf8, 0xff,
0xff, 0xff, 0x8f, 0x80, 0xf8, 0xff, 0xff, 0xff, 0x8f, 0x80, 0xf8, 0xff, 0xff, 0xff, 0x87, 0x80,
0xf8, 0xff, 0xff, 0xff, 0x87, 0x80, 0xf8, 0xff, 0xff, 0xff, 0x87, 0x80, 0xf8, 0xff, 0xff, 0xff,
0x87, 0x80, 0xf8, 0xff, 0xff, 0xff, 0x8f, 0x80, 0xf8, 0xff, 0xff, 0xff, 0x8f, 0x80, 0xf8, 0x7f,
0xff, 0xff, 0x8f, 0x80, 0xf8, 0x7f, 0xff, 0xff, 0x1f, 0x80, 0xf8, 0x7f, 0xff, 0xfe, 0x1f, 0x80,
0xfc, 0x7f, 0xff, 0xfc, 0x3f, 0x80, 0xfc, 0x7f, 0xff, 0xf8, 0x7f, 0x80, 0xfc, 0x7f, 0xff, 0xf0,
0xff, 0x80, 0xfc, 0x3f, 0xff, 0xc1, 0xff, 0x80, 0xfe, 0x3f, 0xff, 0x03, 0xff, 0x80, 0xfe, 0x3f,
0xfc, 0x0f, 0xff, 0x80, 0xfe, 0x1f, 0xe0, 0x1f, 0xff, 0x80, 0xff, 0x0f, 0x00, 0x7f, 0xff, 0x80,
0xff, 0x80, 0x03, 0xff, 0xff, 0x80, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0x80, 0xff, 0xf0, 0xff, 0xff,
0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff,
0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80,
0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80
};
These are my includes
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>
#include <Automaton.h>
#include <Wire.h>
I have set up the display with
#if defined(ARDUINO_FEATHER_ESP32) // Feather Huzzah32
#define TFT_CS 14
#define TFT_RST 15
#define TFT_DC 32
#elif defined(ESP8266)
#define TFT_CS 4
#define TFT_RST 16
#define TFT_DC 5
#else
// For the breakout board, you can use any 2 or 3 pins.
// These pins will also work for the 1.8" TFT shield.
#define TFT_CS 10
#define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC 8
#endif
The code is
tft.drawBitmap(100, 200, lamp, 50, 50, ST77XX_BLACK);
What am I doing wrong?