Giter Club home page Giter Club logo

arduino_gfx's Introduction

Arduino_GFX

Arduino_GFX is a Arduino graphics library supporting various displays with various data bus interfaces.

This library start rewrite from Adafruit_GFX, LovyanGFX, TFT_eSPI, Ucglib, and more...

GitHub release (latest by date) GitHub Release Date GitHub commits since latest release (by date) GitHub last commit

GitHub Sponsors Twitter Follow

Ease of use

Simple Declaration

#include <Arduino_GFX_Library.h>
Arduino_DataBus *bus = new Arduino_HWSPI(16 /* DC */, 5 /* CS */);
Arduino_GFX *gfx = new Arduino_ILI9341(bus, 17 /* RST */);

And Simple Usage

gfx->begin();
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");

Get Started

If you are new on this library, I always recommend try Library Example PDQgraphicstest first. You can find it at Arduino IDE -> File menu -> Examples -> GFX Library for Arduino -> PDQgraphicstest.

After open the example, you can see many tabs. The first is PDQgraphicstest, the main program. Start from the second tab, it is related header files, Arduino_GFX_databus.h, ... etc.

Using supported Dev Device

If you are using below listed support dev device, simply select the Arduino_GFX_dev_device.h and uncomment the define of your dev device. E.g. if you are using LilyGo T-Deck:

...
// #define JC3248W535
#define LILYGO_T_DECK
// #define LILYGO_T_DISPLAY
...

Custom device and display

If you are not using supported dev device:

  • Default DataBus is using Arduino SPI. Other DataBus can modify in Arduino_GFX_databus.h.

  • Default Display is using ILI9341 LCD. Other Display can modify in Arduino_GFX_display.h.

More Details

U8g2 Font Support

U8g2 provided various font type and stored in compressed format. So U8g2 font gives more UI design possibilities and still can fit in the MCU limited storage space. Using U8g2 font in Arduino_GFX simply include U8g2lib.h before Arduino_GFX_Library.h:

#include <U8g2lib.h>
#include <Arduino_GFX_Library.h>

And then setfont file to use:

gfx->setCursor(10, 20);
gfx->setFont(u8g2_font_maniac_tr);
gfx->println("Hello World!");

U8g2 font list can be found at: https://github.com/olikraus/u8g2/wiki/fntlistall

U8g2 Unicode (UTF8) Font Support

Another U8g2 font advantage is the font support Unicode glyphs. Simply enable setUTF8Print:

gfx->begin();
gfx->fillScreen(BLACK);
gfx->setUTF8Print(true);

And then print UTF8 string as usual:

gfx->setCursor(0, 16);

gfx->setFont(u8g2_font_unifont_tr);
gfx->println("Hello World!");

gfx->setFont(u8g2_font_unifont_t_polish);
gfx->println("Witaj świecie!");

gfx->setFont(u8g2_font_unifont_t_vietnamese1);
gfx->println("Chào thế giới!");

gfx->setFont(u8g2_font_unifont_t_chinese2);
gfx->println("世界你好!");

gfx->setFont(u8g2_font_unifont_t_japanese1);
gfx->println("こんにちは世界!");

gfx->setFont(u8g2_font_unifont_t_korean1);
gfx->println("안녕하세요, 세계입니다!");

U8g2 Unifont list can be found at: https://github.com/olikraus/u8g2/wiki/fntgrpunifont

Extra Fonts

Besides U8g2 generated font, Arduino_GFX also generated some useful font set:

u8g2_font_chill7_h_cjk
  • Glyphs: 13478/13478
  • Size: 254,960
  • Generation script:
otf2bdf ChillBitmap7x.ttf -p 6 -o ChillBitmap7x.bdf
bdfconv -v -f 1 -b 1 -m "0-4294967295" ChillBitmap7x.bdf -o u8g2_font_chill7_h_cjk.h -n u8g2_font_chill7_h_cjk
u8g2_font_cubic11_h_cjk
  • Glyphs: 10167/10167
  • Size: 337,650
  • Generation script:
otf2bdf Cubic_11_1.013_R.ttf -p 9 -o Cubic_11_1.013_R.bdf
bdfconv -v -f 1 -b 1 -m "0-4294967295" Cubic_11_1.013_R.bdf -o u8g2_font_cubic11_h_cjk.h -n u8g2_font_cubic11_h_cjk
u8g2_font_quan7_h_cjk
  • Glyphs: 18082/18082
  • Size: 335,225
  • Generation script:
./bdfconv -v -f 1 -b 1 -m "0-4294967295" quan.bdf -o u8g2_font_quan7_h_cjk.h -n u8g2_font_quan7_h_cjk
u8g2_font_unifont_h_utf8
  • Glyphs: 57389/57389
  • Size: 2,250,360
  • Generation script:
bdfconv -v -f 1 -b 1 -m "0-1114111" unifont_jp-14.0.02.bdf -o u8g2_font_unifont_h_utf8.h -n u8g2_font_unifont_h_utf8
u8g2_font_unifont_t_chinese
  • Glyphs: 22145/57389
  • Size: 979,557
  • Generation script:
bdfconv -v -f 1 -m "32-127,11904-12351,19968-40959,63744-64255,65280-65376" unifont_jp-14.0.02.bdf -o u8g2_font_unifont_t_chinese.h -n u8g2_font_unifont_t_chinese
u8g2_font_unifont_t_chinese4
bdfconv -v -f 1 -M chinese4.list unifont_jp-14.0.02.bdf -o u8g2_font_unifont_t_chinese4.h -n u8g2_font_unifont_t_chinese4
u8g2_font_unifont_t_cjk
  • Glyphs: 41364/57389
  • Size: 1,704,862
  • Generation script:
bdfconv -v -f 1 -m "32-127,4352-4607,11904-12255,12288-19903,19968-40943,43360-43391,44032-55203,55216-55295,63744-64255,65072-65103,65280-65519" unifont_jp-14.0.02.bdf -o u8g2_font_unifont_t_cjk.h -n u8g2_font_unifont_t_cjk
Performance

This library is not putting speed at the first priority, but still paid much effort to make the display look smooth.

Figures

Below are some figures compare with other 3 Arduino common display libraries.

  • Arduino IDE: 1.8.15
  • arduino-esp32: 1.0.6
  • Dev Board: TTGO T8 v1.8
  • PSRAM: disable
  • Display: ILI9341
  • Interface: SPI
  • SPI Frequency: 40MHz
  • Test time: 2021 Jun 16
Benchmark Adafruit_GFX Arduino_GFX Lovyan_GFX TFT_eSPI
Screen fill 195,782 160,094 154,341 155,938
Text 97,662 18,960 22,473 21,752
Pixels 1,365,211 903,549 867,702 775,781
Lines 1,062,311 412,026 269,060 264,950
Horiz/Vert Lines 17,637 14,197 13,692 13,833
Rectangles-filled 406,817 332,696 320,761 323,908
Rectangles 11,641 9,254 8,545 8,714
Triangles-filled 150,941 118,010 105,661 109,675
Triangles 58,843 23,570 15,884 16,277
Circles-filled 76,739 52,170 42,787 45,827
Circles 118,125 40,955 25,959 25,269
Arcs-filled N/A 33,381 21,546 N/A
Arcs N/A 66,054 47,901 N/A
Rounded rects-fill 408,534 338,136 318,882 323,189
Rounded rects 43,185 21,562 13,089 15,371

Why Run Fast?

  • No read operation. Since not all display provide read back graphic memories API, Arduino_GFX skip all read operations. It can reduce the library size footprint and sometimes reduce the operation time.
  • Tailor-made data bus classes. Arduino_GFX decouple data bus operation from display driver, it is more easy to write individual data bus class for each platform.
Supported Interfaces

Various data bus interfaces

Arduino_GFX utilizes Arduino Built-in SPI class to support 8-bit SPI for most platforms.

Most tiny displays in hobbyist electronics world support 8-bit SPI, but some require 9-bit SPI. Arduino_GFX should be the first Arduino display library that can use ESP32 SPI to support 9-bit hardware SPI. It is important to support the displays that require 9-bit SPI interface. (e.g. HX8357B, ...)

Larger displays most likely do not support standalone SPI since it is not fast enough to refresh the full screen details. Most of them support 8-bit/16-bit Parallel interface.

Some larger display require RGB + 3-bit SPI combo interface, This interface requies at most 3(9-bit SPI) + 4(CS, CD, WR, RD) + 24(RBG888) = 31 pins. Most dev board do not have enough GPIO to support this. Arduino_GFX is stick to RGB565 color, so RGB666 and RGB888 require some connection hack. E.g. RGB666 connect R5 and R6 together, B5 and B6 together to become RGB565. Then the least GPIO requirement can become 3(9-bit SPI) + 2(CD, WR) + 16(RBG565) = 21 pins. Remember always pull down CS pin and always pull up RD pin.

Currently Supported data bus [Wiki]

  • 8-bit and 9-bit hardware SPI (ESP32SPI)
  • 8-bit hardware SPI (HWSPI, ESP8266SPI, mbedSPI, NRFXSPI, RPiPicoSPI)
  • 8-bit and 9-bit software SPI (SWSPI)
  • 8-bit parallel interface (SWPAR8, AVRPAR8, ESP32LCD8, ESP32PAR8, ESP32S2PAR8, RPiPicoPAR8, RTLPAR8, STM32PAR8)
  • 16-bit parallel interface (ESP32LCD16, ESP32PAR16, ESP32S2PAR16, RPiPicoPAR16)
  • RGB565+SPI interface (ESP32RGBPanel)

Note

ESP32LCD8, ESP32LCD16 and ESP32RGBPanel only supported by arduino-esp32 v2.x and no longer support in v3.0.

Supported Dev Board

Currently Supported Dev Board

Supported Dev Device

Currently Supported Dev Device [Wiki]

Supported Display

Currently Supported Display [Wiki]

Tobe Support Display (Sponsors can make it happen)

  • Mono display supported by co-operate with Canvas
  • Multi-color e-ink display supported by co-operate with Canvas
Canvas (framebuffer)

Canvas Class [Wiki]

  • Arduino_Canvas (16-bit pixel)
  • Arduino_Canvas_3bit (1/4 memory space of 16-bit pixel)
  • Arduino_Canvas_Indexed (half memory space of 16-bit pixel)
  • Arduino_Canvas_Mono (1/16 memory space of 16-bit pixel)
LVGL Support

3 LVGL demo in Library Examples

  • LvglBenchmark [demo video]
  • LvglHelloWorld
  • LvglWidgets
Feature Wishlist

Sponsors can make it happen

  • Print color Emoji Characters
  • Load bitmap font files from flash / SD
  • Fill Gradient (Discussion #128)
Using source code come from

Sponsorship vs Support

As you may already aware there are lack of sponsorship in this project. Convert the funding in terms of man power, it is much lower than 1 man hour per month. So don't expect too much on the support. Expecially the features not realted to my planned maker projects ;>

For the same reason, Arduino_GFX only focus on the Arduino IDE support. Any other IDE, e.g. PlatformIO, if you found an issue at that IDE but normal at Arduino IDE, please direct report to that IDE for better support.

arduino_gfx's People

Contributors

and3rson avatar benlye avatar blauvster avatar chmilw avatar danforever avatar dl9rdz avatar eeeebin avatar figueiredostable avatar goddade avatar ladyada avatar lukaswnd avatar makerm0 avatar makermelissa avatar mathertel avatar monte-monte avatar moononournation avatar nielsnl68 avatar nrjn avatar pkendall64 avatar scottmudge avatar shridattdudhat avatar svenmb avatar xidameng avatar zinggjm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_gfx's Issues

The screen does not display the correct color

As the title says,When I use Arduino_GFX, the color on the screen is not real. The color is very bright. But it can be displayed normally when LCDWIKI_SPI is used. And if I use LCDWIKI_SPI to initialize the screen first, and keep the power on, then burn another sketch written in Arduino_GFX again. It still shows the right colors, even if I press the rest key to restart. But once I turn off the power and restart Arduino, the color will become untrue. I don't know what the problem is, but I still want to use your API because it takes less memory.Do you have any suggestions for solving this problem?

My Screen: 2.0inch Arduino SPI Module ILI9225 SKU:MAR2001

Arduino_GFX:
Arduino_GFX

LCDWIKI_SPI:
LCDWIKI_SPI

ESP32 ILI9341 Software SPI doesnt work but Adafruit GFX and tft-eSPI does

Hello i have this config: // For the Adafruit shield, these are the default.
#define TFT_DC 2
#define TFT_CS 15
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_RST 4
#define TFT_MISO 19

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST, TFT_MISO);

and AdafruitGFX works, and TFT_eSPI too.

i tried:
//Arduino_DataBus bus = new Arduino_ESP32SPI(2 / DC /, 15 / CS /, 18 / SCK /, 23 / MOSI /, -1 / MISO /, VSPI / spi_num */);
Arduino_DataBus bus = new Arduino_ESP32SPI(2 / DC /, 15 / CS */, SCK, 23, -1);
Arduino_ILI9341 gfx = new Arduino_ILI9341(bus, 4 / RST / , 0 / rotation */ );

and nothing works...

can you help?

Thanks.
Marc.

Align all display rotation orientation with display FPC

This is an never closing issue.

I would like to align all display rotation orientation with display FPC. But I am still struggling the display FPC should be at 6 o'clock or 12 o'clock.
At the beginning I believe the FPC should be at 12 o'clock. However, I found many breakout board silk print text told me the FPC should be at 6 o'clock.
Welcome to leave your comment here.

code does not build with preferences/compiler warnings: all

If you use the arduino environment, can you go to file/preferences/compiler warning: all

Then, build the animatedgifs example (I used ESP32 as a target) and you get those errors. They may not be coding errors, but they are enough of a potential problem that the compiler treats them as such:

/home/merlin/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -I/home/merlin/arduino/hardware/espressif/esp32/tools/sdk/include/esp-face -I/home/merlin/arduino/hardware/espressif/esp32/tools/sdk/include/fb_gfx -std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wextra -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti -MMD -c -DF_CPU=240000000L -DARDUINO=10812 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=5 -I/home/merlin/arduino/hardware/espressif/esp32/cores/esp32 -I/home/merlin/arduino/hardware/espressif/esp32/variants/esp32 -I/home/merlin/Arduino/libraries/Arduino_GFX/src -I/home/merlin/arduino/hardware/espressif/esp32/libraries/SPIFFS/src -I/home/merlin/arduino/hardware/espressif/esp32/libraries/FS/src -I/home/merlin/arduino/hardware/espressif/esp32/libraries/SPI/src /tmp/arduino_build_753374/sketch/ImgViewerAnimatedGIF.ino.cpp -o /tmp/arduino_build_753374/sketch/ImgViewerAnimatedGIF.ino.cpp.o
In file included from /home/merlin/arduino/libraries/Arduino_GFX/examples/ImgViewerAnimatedGIF/ImgViewerAnimatedGIF.ino:248:0:
/tmp/arduino_build_753374/sketch/GifClass.h: In member function 'void GifClass::read_plain_text_ext(gd_GIF*)':
/tmp/arduino_build_753374/sketch/GifClass.h:282:19: warning: unused variable 'sub_block' [-Wunused-variable]
             off_t sub_block;
                   ^
/tmp/arduino_build_753374/sketch/GifClass.h: In member function 'void GifClass::reset_table(gd_Table*, int32_t)':
GifClass.h:418:59: error: narrowing conversion of 'key' from 'int32_t {aka int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
             table->entries[key] = (gd_Entry){1, 0xFFF, key};
                                                           ^
/tmp/arduino_build_753374/sketch/GifClass.h: In member function 'int32_t GifClass::read_image_data(gd_GIF*, int, uint8_t*)':
/tmp/arduino_build_753374/sketch/GifClass.h:502:15: warning: unused variable 'start' [-Wunused-variable]
         off_t start, end;
               ^
/tmp/arduino_build_753374/sketch/GifClass.h:502:22: warning: unused variable 'end' [-Wunused-variable]
         off_t start, end;
                      ^
/tmp/arduino_build_753374/sketch/GifClass.h: In member function 'void GifClass::render_frame_rect(gd_GIF*, uint16_t*, uint8_t*)':
/tmp/arduino_build_753374/sketch/GifClass.h:627:25: warning: unused variable 'color' [-Wunused-variable]
         uint8_t index, *color;
                         ^
/tmp/arduino_build_753374/sketch/GifClass.h: In member function 'int32_t GifClass::read_image_data(gd_GIF*, int, uint8_t*)':
GifClass.h:436:77: error: 'entry.gd_Entry::suffix' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         table->entries[table->nentries] = (gd_Entry){length, prefix, suffix};
                                                                             ^
/tmp/arduino_build_753374/sketch/GifClass.h:501:18: note: 'entry.gd_Entry::suffix' was declared here
         gd_Entry entry;
                  ^
GifClass.h:536:32: error: 'str_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                 ret = add_entry(gif->table, str_len + 1, key, entry.suffix);
                                ^
GifClass.h:533:18: error: 'table_is_full' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             else if (!table_is_full)
                  ^
cc1plus: some warnings being treated as errors

error: expected type-specifier before 'Arduino_NRFXSPI'

Hi there, I'm getting an error using the Adafruit nRF52840 Feather board:

error: expected type-specifier before 'Arduino_NRFXSPI'
 Arduino_DataBus *bus = new Arduino_NRFXSPI(2 /* DC */, 3 /* CS */, 14 /* SCK */, 13 /* MOSI */, 15 /* MISO */);

Here is my declaration:

//Begin TFT
#define ARDUINO_ARCH_NRF52840
#include <Arduino_GFX_Library.h>
#define TFT_BL 30 /*Backlight control, pin 'A2'.*/
Arduino_DataBus *bus = new Arduino_NRFXSPI(2 /* DC */, 3 /* CS */, 14 /* SCK */, 13 /* MOSI */, 15 /* MISO */);
Arduino_GFX *gfx = new Arduino_ST7735(bus, 28 /*RST*/, 0 /* rotation */, false /* IPS */);
//End TFT

The declaration appears correct for this platform, can you help? Thanks!

Arduino_Duplicate_Display driver support

Hi,

Great work @moononournation !

I want to add an Arduino_Duplicate_Display driver with a constructor like:
Arduino_Duplicate_Display(Arduino_GFX *gfxs[]);
And I want it to override all of the Arduino_GFX and Arduino_TFT needed functions so we can use it like:

Arduino_DataBus *bus = new Arduino_ESP32SPI(BUS_DC_PIN, -1, BUS_SCK_PIN, BUS_DAT_PIN, -1, BUS_SPI_ID);

Arduino_GFX *gc9a01 = new Arduino_GC9A01(bus, GC9A01_CS_PIN, BUS_RST_PIN); // 240x240px
Arduino_GFX *st7789 = new Arduino_ST7789(bus, ST7789_CS_PIN, BUS_RST_PIN); // 240x240px
Arduino_GFX *ssd1351 = new Arduino_SSD1351(bus, SSD1351_CS_PIN, BUS_RST_PIN); // 128x128px

Arduino_GFX *gfxs[] = {gc9a01, st7789, ssd1351, NULL};
Arduino_GFX *gfx = new Arduino_Duplicate_Display(gfxs);

void setup(void)
{
  // on all displays:
  gfx->begin();
  gfx->fillScreen(BLACK);
  gfx->setCursor(10, 10);
  gfx->setTextColor(RED);
  gfx->println("Hello World!");
  // can also do:
  ssd1351->fillScreen(GREEN);
}

But I have some problems:

1. I need the Arduino_TFT and ALL the display drivers to accept the uint8_t cs_pin argument in their constructors.
I don't understand why the Arduino_DataBus needs the cs pin? I think this pin is needed per display not per bus!
2. Do I need to inherit from Arduino_GFX or Arduino_TFT?
The problem with Arduino_TFT is that it needs a bus in its constructor, but it implements more functions like:
begin, invertDisplay, displayOn, displayOff, writeRepeat, writeAddrWindow, setAddrWindow...
3. Do you think a NULL terminated array of displays it good for the Arduino_Duplicate_Display constructor?

Looking forward,
Arad :)

key_size in GifClass.h

Hello again,
First, when you get a chance, try to recompile all your code with all warnings enabled in the arduino IDE (preferences/settings/compiler warnings/all)

this one is a compilation error on ESP32:

GifClass.h:417:59: error: narrowing conversion of 'key' from 'int32_t {aka int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
             table->entries[key] = (gd_Entry){1, 0xFFF, key};

I can change line 417 to say
for (uint8_t key = 0; key < (1 << key_size); key++)

but I'm not too sure if key_size is smaller than 8, it looks like maybe not.

line 503, I see:
gif_buf_read(gif->fd, &byte, 1);
key_size = (int16_t)byte;

If it's a byte, why use (int16_t), shouldn't this be uint8_t ?

Later down, I see
clear = 1 << key_size;

with
uint16_t key, clear, stop;

So key is actually 16bits instead of 8. and 1 << key_size likely is 16 bits and not 8 bits.

So maybe suffix in gd_Entry should be 16 bits?

typedef struct gd_Entry
{
    int32_t length;
    uint16_t prefix;
    uint8_t suffix;
} gd_Entry;

Help with esp_jpg_decode

Hi, sorry to bother you with a general programming question but this repository has the only example of using the esp_jpg_decode function that I could find. I want to use it with with jpgs from a camera feed and can't work out how to read them for the decoder. I understand it reads and processes in chunks but I'm not sure how to make it work. My code is below. Any ideas?

esp_err_t camera_capture()
{
  camera_fb_t * fb = esp_camera_fb_get();

  esp_jpg_decode(fb->len, JPG_SCALE_NONE, camera_buffer_reader, array_writer, fb);

  esp_camera_fb_return(fb);
}

static size_t camera_buffer_reader(void *arg, size_t index, uint8_t *buf, size_t len)
{
  camera_fb_t * fb = (camera_fb_t *)arg;
  buf = (uint8_t *)fb->buf;
  Serial.println(fb->len);
  return fb->len;
}

static bool array_writer(void *arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data)
{
  Serial.println("writer");
  if (data)
  {
    Serial.printf("%d, %d, %d, %d\n", x, y, w, h);
  }
  feedLoopWDT();
  return true; // Continue to decompression
}

Seeeduino XIAO compatibility, swSPI works, hwSPI don’t

Hello, thank you for the amazing work!

I’m trying to use a Seeeduino XIAO with a GC9A01 round display.
It works via swSPI and hwSPI with the library you can find at this link:

https://www.buydisplay.com/arduino/ER-TFTM1.28-1_Arduino_Tutorial.zip

But I would like to use your library, it works with swSPI, but doesn’t work wit hwSPI.

There is a way to implement the hwSPI functionality? Or something to edit to make it working?

Thank you very much.

Christian

Documentation: Arduino_HWSPI vs ESP32SPI vs ESP32SPI_DMA

First, I wanted to give a huge thumbs up for your excellent work on this library. The amount of MCU support, types of communication support and number of TFTs, is really good, thank you.

Is it possible to explain in the documentation for regular SPI (not 4bit or 8/9bit), the difference between:

  • Arduino_HWSPI(TFT_DC, TFT_CS)
  • Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO, VSPI )
  • Arduino_ESP32SPI_DMA(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO, VSPI);

Are they not all supposed to be using hardware SPI if I use VSPI pins? Yet, they are not all the same speed, ESP32SPI_DMA is definitely faster. Is it a better implementation of the HW SPI stack? Still, doesn't HW SPI use support inside the chip?
I'm just curious about what you made faster :)

gfx->setRotation(0) works for jpg but not for gifs

When trying to change the orientation of the display the gfx->setRotation(X); method works well for jpgs
With a strange mapping on my setup at least where 0 -> 0 degrees 1 -> 180 degrees, 2 -> 90 degrees, 3 -> 270 degrees

But when any gfx->setRotation(X) is set the gif playback is empty :/

Would appreciate any input, thank-you

Here is the function

static void play_gif(File gifFile, char* filename, uint8_t repeats, uint16_t rotation)
{
if (!gifFile || gifFile.isDirectory())
{
show_fail_message(F("ERROR: open gifFile Failed!"), 1000);
return;
}

display_on();
set_rotation(rotation);

// read GIF file header
gd_GIF *gif = gifClass.gd_open_gif(&gifFile);
if (!gif)
{
show_fail_message(F("gd_open_gif() failed!"), 1000);
return;
}

int32_t gif_frame_size = gif->width * gif->height;
uint8_t *buf = (uint8_t *)malloc(gif_frame_size);
if (!buf)
{
show_fail_message(F("ERROR: buf malloc failed!"), 1000);
return;
}
Serial.println(F("GIF video start"));
gfx->setAddrWindow((gfx->width() - gif->width) / 2, (gfx->height() - gif->height) / 2, gif->width, gif->height);

int t_fstart, t_delay = 0, t_real_delay, res, delay_until;
int duration = 0, remain = 0;
uint8_t counter = 0;
uint32_t idle_counter = 0;
uint32_t sd_fetch_time = 0;
uint32_t draw_time = 0;

while (counter < repeats)
{
t_fstart = millis();
t_delay = gif->gce.delay * 10;
res = gifClass.gd_get_frame(gif, buf);
sd_fetch_time = millis() - t_fstart;
if (res < 0)
{
Serial.println(F("ERROR: gd_get_frame() failed!"));
break;
}
else if (res == 0)
{
Serial.print(F("rewind, duration: "));
Serial.print(duration);
Serial.print(F(", remain: "));
Serial.print(abs(remain));
Serial.print(F(" ("));
Serial.print(100.0 * abs(remain) / duration);
Serial.println(F("%)"));
Serial.print(F("SD Time = "));
Serial.println(sd_fetch_time);
Serial.print(F("Draw Time = "));
Serial.println(draw_time);
duration = 0;
remain = 0;
gifClass.gd_rewind(gif);
counter += 1;
continue;
}
gfx->startWrite();
gfx->writeIndexedPixels(buf, gif->palette->colors, gif_frame_size);
gfx->endWrite();
draw_time = millis() - t_fstart;

t_real_delay = t_delay - (millis() - t_fstart);
duration += t_delay;
remain += t_real_delay;
delay_until = millis() + t_real_delay;
do
{
  delay(1);
  idle_counter += 1;
} while (millis() < delay_until);

}
free(buf);
gifClass.gd_close_gif(gif);
display_off();
Serial.println(F("GIF video end"));
}

Minior compile issues with lates xtensa compiler

If i may contribute i can push minor changes in:

    modified:   Arduino_GFX.cpp
    modified:   Arduino_SSD1283A.cpp
    modified:   Arduino_TFT.cpp               
    modified:   Arduino_TFT_18bit.cpp    // type conversion issues and offset may be not initialized

    modified:   glcdfont.c    // font defined but not used:

ImgViewerAnimatedGIF crashes with ezgif.com-optimize.gif but works with ezgif.com-resize.gif

File: /ezgif.com-optimize.gif
new_table() malloc: 32776
GIF video start
Guru Meditation Error: Core  1 panic'ed (LoadStoreError). Exception was unhandled.
Core 1 register dump:
PC      : 0x400d17c1  PS      : 0x00060130  A0      : 0x800d1b55  A1      : 0x3ffb1eb0  
A2      : 0x3ffc00a4  A3      : 0x3ffb20f8  A4      : 0x40041574  A5      : 0x00000000  
A6      : 0x00000fff  A7      : 0x3ffd1cb7  A8      : 0x3ffc9d94  A9      : 0x00000000  
A10     : 0x0000028e  A11     : 0x00000093  A12     : 0x0000fefe  A13     : 0x3ffb24f8  
A14     : 0x3ffb24f8  A15     : 0x00000008  SAR     : 0x00000016  EXCCAUSE: 0x00000003  
EXCVADDR: 0x40041578  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000  

Backtrace: 0x400d17c1:0x3ffb1eb0 0x400d1b52:0x3ffb1f20 0x400d6ac3:0x3ffb1fb0 0x4008a529:0x3ffb1fd0

Rebooting...
PC: 0x400d17c1: GifClass::read_image_data(gd_GIF*, short, unsigned char*) at /tmp/arduino_build_303251/sketch/GifClass.h line 575

I changed the code to display the array element:

                else
		{
		    Serial.println(entry.prefix);
		    Serial.flush();
                    entry = gif->table->entries[entry.prefix];
		}

and I see this before it dies:

32
590
589
522
352
351
350
2
24149
65278
Guru Meditation Error: Core  1 panic'ed (LoadStoreError). Exception was unhandled.

Help with flickering

Hi, does your library support off-screen canvases?
In other words, can I do this:

// In global declarations:
GFXcanvas1 canvas(128, 32); // 128x32 pixel canvas

// In code later:
canvas.println("I like cake");
tft.drawBitmap(x, y, canvas, 128, 32, foreground, background); // Copy to screen

as it is done in Adafruit version of GFX?

I am interested in implementing blinking-free redraws...
https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts

Thanks!

Great work supporting 3-wire SPI! I searched high and low before finding your lib. Thanks!

Playing GIFs from SD card is Slow

Using ESP32 + SD card to playback a gif.
The playback is about 70% slower than it should be, playing from SPIFFS was much faster and exactly the same as the playback on my computer

I am noticing that the time to get the frame is slower than the allotted time determined from t_delay, fetching of the GIF frame of the SD card must be taking too long.

I have both the GC9A01 and the SD card on the VSPI bus, I'm wondering if we can get the playback fast enough or will we need to put the display and SD card on separate busses and then have two tasks running. One to fetch the next GIF frame, the other to play it back.

Thanks in advance

Some bugs with SSD1331

By default the screen is unstable and shows artifacts with solid color on ESP32.

Fixed by editing Arduino_SSD1331.cpp

Change Original:

  _bus->sendCommand(SSD1331_PRECHARGEA); // 0x8A
  _bus->sendCommand(0x64);
  _bus->sendCommand(SSD1331_PRECHARGEB); // 0x8B
  _bus->sendCommand(0x78);
  _bus->sendCommand(SSD1331_PRECHARGEA); // 0x8C
  _bus->sendCommand(0x64);
  _bus->sendCommand(SSD1331_PRECHARGELEVEL); // 0xBB
  _bus->sendCommand(0x3A);
  _bus->sendCommand(SSD1331_VCOMH); // 0xBE
  _bus->sendCommand(0x3E);

To Updated:

  _bus->sendCommand(SSD1331_PRECHARGEA); // 0x8A
  _bus->sendCommand(0x0);
  _bus->sendCommand(SSD1331_PRECHARGEB); // 0x8B
  _bus->sendCommand(0x0);
  _bus->sendCommand(SSD1331_PRECHARGEC); // 0x8C
  _bus->sendCommand(0x0);
  _bus->sendCommand(SSD1331_PRECHARGELEVEL); // 0xBB
  _bus->sendCommand(0x0);
  _bus->sendCommand(SSD1331_VCOMH); // 0xBE
  _bus->sendCommand(0x0);

ESP32 M5STACK doesn't work anymore in the new version :-(

#include <Arduino_GFX_Library.h>
#define TFT_BL 32
Arduino_DataBus bus = new Arduino_ESP32SPI(27 / DC /, 14 / CS */, SCK, MOSI, MISO);
Arduino_GFX gfx = new Arduino_ILI9341_M5STACK(bus, 33 / RST /, 1 / rotation */);

i did include like this...

and got this error:

expected type-specifier before 'Arduino_ILI9341_M5STACK'

Can you help ?
Thanks.
Marc.

File system mount failed

I get the following error after uploading the data and sketch to esp32
E (512) SPIFFS: mount failed, -10025
Please help in resolving the same

“a15 cannot be used in asm here”in platform io

hello,i'm very new to use platform with arduino, when I use this in,it show error messages,my ini files,i use the clock as the main.cpp files.


  [env:d1]
  platform = espressif8266
  board = d1
  framework = arduino
  lib_deps=
      moononournation/GFX Library for Arduino @ ^1.1.2
      moononournation/GFX Library for Arduino @ ~1.1.2
      moononournation/GFX Library for Arduino @ 1.1.2

error messages

    .pio/libdeps/d1/GFX Library for Arduino/src/Arduino_TFT.cpp:1125:1: error: a15 cannot be used in asm here

will thanks for your help.

Please help! I cant compile sketch for esp8266(((

I cant even compile example sketches. I tried compile for any esp boards and any example sketch and always i get the same error.

C:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src\Arduino_TFT.cpp: In member function 'virtual void Arduino_TFT::drawChar(int16_t, int16_t, unsigned char, uint16_t, uint16_t)':
C:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src\Arduino_TFT.cpp:1010:1: error: a15 cannot be used in asm here
}
^
C:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src\Arduino_TFT.cpp:1010:1: error: a15 cannot be used in asm here
exit status 1
Compilation error for board Wemos D1 mini.

I used:
IDE: Arduino IDE 1.8.13
Board: Wemos D1 mini ESP 8266
Display: GC9A01

error when compiling for GC9A01

Hi, this is awesome. After seeing your video I ordered the same screen (I needed a circle screen for one project). Today I received it but i cant compile the code I always end up with an error... could you please share your exact code for this display? thanks :)

here is the error:
multiple libraries were found for "Arduino_HWSPI.h"
In file included from C:\Users\nicol\OneDrive\Documents\Arduino\libraries\Arduino_GFX-master\Arduino_ESP32SPI_DMA.cpp:7:0:

Used: C:\Users\nicol\OneDrive\Documents\Arduino\libraries\Arduino_GFX-master
C:\Users\nicol\OneDrive\Documents\Arduino\libraries\Arduino_GFX-master\Arduino_ESP32SPI_DMA.h:19:19: fatal error: unity.h: No such file or directory

compilation terminated.

exit status 1

Arduino_ESP32PAR8 is not allowing LCD write pin above 31 on ESP32

Hey,

I need to use the write pin of my ILI9486 device to be above 31. This pin is shared with the touch panel and since ESP32 cannot use ADC2 together with WiFi, I have to use ADC1 (pins above 31). I have found a way to allow the use of this pin by tweaking the file "\databus\Arduino_ESP32PAR8.cpp" as follows (starting from line 331 in this file):

INLINE void Arduino_ESP32PAR8::WRITE(uint8_t d)
{
uint32_t mask = xset_mask[d];
*dataPortClr = dataClrMask;
*dataPortSet = mask;
#if !defined(SET_DATA_AND_WR_AT_THE_SAME_TIME)
*wrPortClr = wrPinMask; // <---- ADD THIS LINE!!!
*wrPortSet = wrPinMask;
#endif // !defined(SET_DATA_AND_WR_AT_THE_SAME_TIME)
}

Is there any chance for you to implement this change in a future release of your code?

Thank you

st7789 135x240 cannot display jpg picture completely.

The last 7 columns cannot display with a jpg picture. You can easily reproduce the problem with the example named ImgViewerJpeg.ino. I change the code
Arduino_ST7789 *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 135 /* width */, 240 /* height */, 53 /* col offset 1 */, 40 /* row offset 1 */, 52 /* col offset 2 */, 40 /* row offset 2 */);
to
Arduino_ST7789 *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 136 /* width */, 240 /* height */, 53 /* col offset 1 */, 40 /* row offset 1 */, 52 /* col offset 2 */, 40 /* row offset 2 */);
the problem was fixed.

I found something.

Draw pos = 0,0. size = 64 x 8
Draw pos = 64,0. size = 64 x 8
Draw pos = 128,0. size = 8 x 8 <--------it does not work
Draw pos = 0,8. size = 64 x 8
Draw pos = 64,8. size = 64 x 8
Draw pos = 128,8. size = 8 x 8 <--------it does not work
Draw pos = 0,16. size = 64 x 8
Draw pos = 64,16. size = 64 x 8
Draw pos = 128,16. size = 8 x 8 <--------it does not work
Draw pos = 0,24. size = 64 x 8
Draw pos = 64,24. size = 64 x 8
Draw pos = 128,24. size = 8 x 8 ......
Draw pos = 0,32. size = 64 x 8
Draw pos = 64,32. size = 64 x 8
Draw pos = 128,32. size = 8 x 8
Draw pos = 0,40. size = 64 x 8
Draw pos = 64,40. size = 64 x 8
Draw pos = 128,40. size = 8 x 8
Draw pos = 0,48. size = 64 x 8
Draw pos = 64,48. size = 64 x 8
Draw pos = 128,48. size = 8 x 8
Draw pos = 0,56. size = 64 x 8
Draw pos = 64,56. size = 64 x 8
Draw pos = 128,56. size = 8 x 8
Draw pos = 0,64. size = 64 x 8
Draw pos = 64,64. size = 64 x 8
Draw pos = 128,64. size = 8 x 8
Draw pos = 0,72. size = 64 x 8
Draw pos = 64,72. size = 64 x 8
Draw pos = 128,72. size = 8 x 8
Draw pos = 0,80. size = 64 x 8
Draw pos = 64,80. size = 64 x 8
Draw pos = 128,80. size = 8 x 8
Draw pos = 0,88. size = 64 x 8
Draw pos = 64,88. size = 64 x 8
Draw pos = 128,88. size = 8 x 8
Draw pos = 0,96. size = 64 x 8
Draw pos = 64,96. size = 64 x 8
Draw pos = 128,96. size = 8 x 8
Draw pos = 0,104. size = 64 x 8
Draw pos = 64,104. size = 64 x 8
Draw pos = 128,104. size = 8 x 8
Draw pos = 0,112. size = 64 x 8
Draw pos = 64,112. size = 64 x 8
Draw pos = 128,112. size = 8 x 8
Draw pos = 0,120. size = 64 x 8
Draw pos = 64,120. size = 64 x 8
Draw pos = 128,120. size = 8 x 8
Draw pos = 0,128. size = 64 x 8
Draw pos = 64,128. size = 64 x 8
Draw pos = 128,128. size = 8 x 8
Draw pos = 0,136. size = 64 x 8
Draw pos = 64,136. size = 64 x 8
Draw pos = 128,136. size = 8 x 8
Draw pos = 0,144. size = 64 x 8
Draw pos = 64,144. size = 64 x 8
Draw pos = 128,144. size = 8 x 8
Draw pos = 0,152. size = 64 x 8
Draw pos = 64,152. size = 64 x 8
Draw pos = 128,152. size = 8 x 8
Draw pos = 0,160. size = 64 x 8
Draw pos = 64,160. size = 64 x 8
Draw pos = 128,160. size = 8 x 8
Draw pos = 0,168. size = 64 x 8
Draw pos = 64,168. size = 64 x 8
Draw pos = 128,168. size = 8 x 8
Draw pos = 0,176. size = 64 x 8
Draw pos = 64,176. size = 64 x 8
Draw pos = 128,176. size = 8 x 8
Draw pos = 0,184. size = 64 x 8
Draw pos = 64,184. size = 64 x 8
Draw pos = 128,184. size = 8 x 8
Draw pos = 0,192. size = 64 x 8
Draw pos = 64,192. size = 64 x 8
Draw pos = 128,192. size = 8 x 8
Draw pos = 0,200. size = 64 x 8
Draw pos = 64,200. size = 64 x 8
Draw pos = 128,200. size = 8 x 8
Draw pos = 0,208. size = 64 x 8
Draw pos = 64,208. size = 64 x 8
Draw pos = 128,208. size = 8 x 8
Draw pos = 0,216. size = 64 x 8
Draw pos = 64,216. size = 64 x 8
Draw pos = 128,216. size = 8 x 8
Draw pos = 0,224. size = 64 x 8
Draw pos = 64,224. size = 64 x 8
Draw pos = 128,224. size = 8 x 8
Draw pos = 0,232. size = 64 x 8
Draw pos = 64,232. size = 64 x 8
Draw pos = 128,232. size = 8 x 8
Time used: 279

esp32 4m flash without psram.
screen: st7789 135x240.

Display Colors Inverted

Hello,
Do you have a user guide available. I need to do things like rotate the display and my colors are inverted. I am sure they are easy corrections but I do not know the commands to do it, Can you please help.

Last row data undefined?

Hi there,

I'm using a 80x160px ST7735 based TFT. My hard-coded offsets/extents are here:

#define TFT_OFFSETX 26
#define TFT_OFFSETY 1
#define ST7735_TFTWIDTH 80
#define ST7735_TFTHEIGHT 160

I draw a rectangle here:

gfx->fillScreen(BLACK);
gfx->drawRect(gOffsetX+TFT_OFFSETX, gOffsetY+TFT_OFFSETY, ST7735_TFTWIDTH, ST7735_TFTHEIGHT, GREEN);

This is the result:

PXL_20210521_165520632

I noticed there are additional offset arguments in the GFX library:

Arduino_ST7735(
      Arduino_DataBus *bus, int8_t rst = -1, uint8_t r = 0,
      bool ips = false, int16_t w = ST7735_TFTWIDTH, int16_t h = ST7735_TFTHEIGHT,
      uint8_t col_offset1 = 0, uint8_t row_offset1 = 0, uint8_t col_offset2 = 0, uint8_t row_offset2 = 0,
      bool bgr = true);

Can you help me understand why the last row contains random data when displayed?

Thanks!

Failed to update new version with Arduino IDE Library Manager

@per1234 reply on this issue:

I see that files were added after the v1.0.7 tag where the path differs only in case:
cd73084

#For example:

https://github.com/moononournation/Arduino_GFX/blob/v1.0.8/examples/ImgViewerAnimatedGIF/Data/ezgif.com-optimize.gif
https://github.com/moononournation/Arduino_GFX/blob/v1.0.8/examples/ImgViewerAnimatedGIF/data/ezgif.com-optimize.gif
(Data vs. data)

While this is perfectly fine on a case sensitive file system like Linux, the two files can not coexist on case insensitive file systems like Windows or macOS. I suspect this is the cause of the silent failure of the Library Manager installation of the 1.0.8 and 1.0.9 versions of the library.

My two displays not works with the library

Hello,

I have two displays, which Your library supports the chipsets, but the displays wont to work with it...
I tried it with Your example.

first display: chipset ILI9486 (works with TFT_eSPI)
second display: chipset ST7796S (not supported by TFT_eSPI)

Can You check why the display not works please?

Thank You!

Hans

Teensy 4.1 HWSPI vs. SWSPI Issues

When I use SWSPI on a Teensy 4.1 and a GC9A01 display, the library works properly. But when I try HWSPI with the same hardware, I just get lines and screen garbage. What am I missing?

Interfacing_Arduino_to_ER-TFTM1.28-1.pdf

Code:

#include "Arduino_GFX_Library.h"

//PINS
#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_SCK 13
#define TFT_MISO -1

Arduino_DataBus *bus = new Arduino_SWSPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO);
//Arduino_DataBus *bus = new Arduino_HWSPI(TFT_DC, TFT_CS);
Arduino_GC9A01 *gfx = new Arduino_GC9A01(bus, TFT_RST, 0 /*rotation*/, true /*IPS*/);

void setup() {
  gfx->begin();
}

void loop() {
  gfx->fillScreen(BLACK);
  delay(500);
  gfx->fillScreen(RED);
  delay(500);
}

Not declared in scope

Hi, I got errors when I using this library

error: 'I2S_NUM_1' was not declared in this scope <<(error from Arduino_ESP32I2S8.h)

error: 'VSPI' was not declared in this scope <<(error from Arduino_ESP32SPI.h)

GIF playback with the STM32F411 BlackPill

I am trying to compile the example for the BlackPill board and am getting this error

error: 'class Arduino_GC9A01' has no member named 'writeIndexedPixels'
121 | gfx->writeIndexedPixels(buf, gif->palette->colors, s);

Looking through the source code it looks like there are some conditional functions if certain boards are defined.
writeIndexedPixels seems to belong to only ESP32.

I really appreciate the work that's gone into this library the examples worked amazingly well on my ESP32; now I'm hoping to build something using the STM32411CEU.

Looking forward to your advice

Thanks

ImgViewerJpeg example the 2nd call to jpegClass.draw fails

I've been trying the ImgViewerJpeg example and seems like whenever I try to display a second image with another call to jpegClass.draw it won't do anything, only the first call to the function succeeds. I tried to debug this issue to no avail

Looks like it sets twice instead of set and then clear

Hi guys,

during migrating Arduino_ESP32PAR8.cpp to stm32 I have noticed, that after

*wrPortSet = wrPinMask;

follows

*wrPortSet = wrPinMask;

looks like it sets twice instead of set and then clear.

To whom it may concern,
unfortunately I do not have ESP32 + "lcd par8+wr" shield to test it
please check it.

Best regards,
Vladyslav

nRf52840 Feather - No GPIO activity

Hi there,

I am seeing no activity on any of the GPIO I'm using to drive my ST7735S TFT. Here is my declaration:

//Begin TFT
#include <Arduino_GFX_Library.h>
//Override pin locations from Arduino_GFX_Library.h
//NOTE: pin numbers follow P0.xx convention, not Arduino Dx convention.
//#define TFT_SCK 14 //SCK
//#define TFT_MOSI 13 //MO
//#define TFT_MISO 15 //MI
#define TFT_CS 3 //A5
#define TFT_DC 2 //A4
#define TFT_RST 28 //A3
#define TFT_BL 30 //A2
//Arduino_DataBus *bus = new Arduino_NRFXSPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO);
Arduino_DataBus *bus = create_default_Arduino_DataBus();
Arduino_GFX *gfx = new Arduino_ST7735(bus, TFT_RST, 0 /* rotation */, false /* IPS */);
//End TFT

Here is my TFT init in setup():

//TFT
  gfx->begin();
  gfx->fillScreen(BLACK);

#ifdef TFT_BL
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(TFT_BL, HIGH);
#endif

  gfx->setCursor(10, 10);
  gfx->setTextColor(RED);
  gfx->println("Hello World!");

I reviewed the pin mapping for the nRF52840 Feather board by Adafruit, and it seems correct.

Can you help me understand why the GPIO are not operating? Thanks!

Fit full PDQgraphicstest in Arduino Nano

Currently full PDQgraphicstest cannot fit in Arduino Nano program flash. 4 tests skipped:

  • Arcs (filled)
  • Arcs (outline)
  • Rounded rects (filled)
  • Rounded rects (outline)

This issue keeps remind me of a size tuning on this.

No simple repeatable GC9A01 off method

Not sure about other screens, but the GC9A01 that I'm testing with does not turn blank when I use gfx->fillScreen(BLACK). It shows full white instead.

I used the displayOff() method but then when I want to show something on the screen after it does not respond. Calling displayOn() does not help.

There should be a simple way to to clear the screen, please tell me I'm just missing something obvious.

Thanks

Default rotation 0

If rotation parameter inputted outside 0-3, should use rotation instead.

Recommendation: move screen/pin definition in common files

(feel free to close this issue after you've read it, there is a suggestion, plus some pointers to my own work that may be useful to you)

The examples you give are really good, but the many many ways to define the screens, is very long because there are so many options (and for good reason).
Have you considered factoring that out into a common file?

For instance, see:

Then you can have the adafruit example like this: https://github.com/marcmerlin/tft-playground/tree/master/ili3941graphicstest
And your example code like that: https://github.com/marcmerlin/tft-playground/tree/master/PDQgraphicstest

This makes it easy to change the pin and screen in one place and all the demos are updated at the same time.

And if you have a little time, please look at
https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos
especially https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/blob/master/neomatrix_config.h
neomatrix_config solves a similar problem to yours: a single config file that contains 2D hardware definition and then all the demos source that file and work automatically.

Currently I support a few TFTs from adafruit lib, but I will add support for your driver because your driver is better :)

If you are curious, I support a lot of different hardware, including RGBPanels and neopixel matrices, see my base class:
https://github.com/marcmerlin/Framebuffer_GFX

The only issue is that my base class is RGB888, which is a bit wasteful for TFTs that are RGB565. For 320x240, the framebuffer is 224KB which is too big on an ESP32 without PSRAM

please rename Data -> data

Examples like ImgViewerAnimatedGIF have a directory called Data that contains files to upload to SPIFFS or FatFS.
The expected name is 'data', not 'Data', so it doesn't work on linux unless I rename it.

It probably works on windows because windows does not care about uppercase and lowercase. On MacOS I'm not sure, I guess it works too?
That said, if you could rename as 'data', it will work on unix too :)

If you'd like me to send you a pull request, let me know, will be happy to

Thanks

Arduino_DataBus.cpp:76:63: error: operation on 'i' may be undefined [-Werror=sequence-point]

Using Arduino IDE 1.8.13 on Windows with your library version 1.1.2 and get the error

Arduino_DataBus.cpp:76:63: error: operation on 'i' may be undefined [-Werror=sequence-point]

in line 76: writeCommand16(((uint16_t)batch[++i] << 8) | batch[++i]);

...\libraries\GFX_Library_for_Arduino\src\Arduino_DataBus.cpp: In member function 'void Arduino_DataBus::batchOperation(uint8_t*, uint8_t)':
...\libraries\GFX_Library_for_Arduino\src\Arduino_DataBus.cpp:76:63: error: operation on 'i' may be undefined [-Werror=sequence-point]
       writeCommand16(((uint16_t)batch[++i] << 8) | batch[++i]);
                                                               ^ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.