Error compiling with TFT library

Absolute newby here...

While compiling this sketch:

#include <SPI.h>
#include <TFT.h>
#include <Arduino_LSM9DS1.h>

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

I got this:

Arduino: 1.8.12 (Windows 7), Placa:"Arduino Nano 33 BLE"

In file included from C:\Program Files (x86)\Arduino\libraries\TFT\src/TFT.h:37:0,

from C:\Users\pjr\Google Drive\wf_meter\wf_meter\wf_meter.ino:3:

C:\Program Files (x86)\Arduino\libraries\TFT\src/utility/Adafruit_ST7735.h:30:10: fatal error: avr/pgmspace.h: No such file or directory

#include <avr/pgmspace.h>

^~~~~~~~~~~~~~~~

compilation terminated.

exit status 1
Erro ao compilar para a placa Arduino Nano 33 BLE.


Probably something wrong on my installation ?

The Arduino TFT library was written specifically for the AVR architecture of the classic Arduino boards (e.g., Uno, Nano, Leonardo, Mega).

The Arduino TFT is only a wrapper around an extremely outdated version of the Adafruit ST7735 and ST7789 Library. I don't own one of these TFT displays to test, but the Adafruit library does compile for the Nano 33 BLE.

You can install it by following these instructions:

  • (In the Arduino IDE) Sketch > Include Library > Manage Libraries
  • Wait for the download to finish.
  • In the "Filter your search" field, type "Adafruit ST7735 and ST7789 Library".
  • Press Enter.
  • From the library search results, click on "Adafruit ST7735 and ST7789 Library by Adafruit".
  • Click the "Install" button.
  • You will now get a dialog asking whether you want to install the library dependencies of the Adafruit ST7735 and ST7789 Library. Click the "Install all" button.
  • Wait for the installation to finish.

After installing the library, you'll find example sketches demonstrating how to use the library under the File > Examples > Adafruit ST7735 and ST7789 Library menu.

There's some additional documentation provided by Adafruit here: