ILI9481 IPS 320x480 - problem with sprites #2859
Unanswered
error105
asked this question in
Q&A - Sprites
Replies: 1 comment
-
I suspect insufficient RAMi is available to create the sprite. Try reducing the sprite size. Typically circa 200x200 is the maximum an ESP32 (without extra PSRAM) will accomodate. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, im use platformio and i cant work with sprites :(
Graphic push via tft works well (slow, but well), but if i want push spirtes text is always on left/high corner and i dont see images :(
Can anybody helps me, and tell me what im make wrong?
My platformio.ini:
[env:esp32dev] platform = espressif32 board = esp32dev framework = arduino board_build.f_cpu = 240000000L upload_flags = monitor_speed = 115200 upload_protocol = espota upload_port = 192.168.0.74 lib_deps = bodmer/TFT_eSPI@^2.5.31 jchristensen/movingAvg@^2.3.1 build_flags = -D USER_SETUP_LOADED=1 -D ILI9481_DRIVER=1 -D TFT_MISO=25 ;SDO D25 -D TFT_MOSI=13 ;SDI D13 -D TFT_SCLK=14 ;D14 -D TFT_CS=26 ;D26 -D TFT_DC=27 ;D27 -D TFT_RST=12 ;D12 -D TOUCH_CS=-1 -D LOAD_GLCD=1 -D SMOOTH_FONT=1 -D SPI_FREQUENCY=27000000 -D SPI_READ_FREQUENCY=20000000 -D SPI_TOUCH_FREQUENCY=2500000
And my code:
`#include <Arduino.h>
//Multi CPU
TaskHandle_t Task1;
//Wyswietlacz
#include <TFT_eSPI.h>
#define pinPodswietlenia 33
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite gaugeBack = TFT_eSprite(&tft);
#include "grafika/background.h"
uint16_t COLORS;
#include "czcionki/mr2font24.h"
#include "czcionki/mr2font32.h"
#include "czcionki/Free_Fonts.h"
float losowa;
void setup() {
tft.begin();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
tft.setSwapBytes(true);
tft.pushImage(0, 0, 160, 160, (uint16_t *)Startowa); (that graphic works fine, but when i comment it, sprites with that graphic dont apear)
Serial.begin(115200);
Serial.println("Serial OK!");
xTaskCreatePinnedToCore(Task1code, "Wyswietlanie", 5000, NULL, 5, &Task1, 0); delay(50);
}
void loop() {
losowa = random(1,2000) * 0.1;
}
void Wyswietlanie(){
gradient(128, 255, 0);
tftZmienne();
}
void gradient(byte red, byte green, byte blue) {
COLORS = (((31 * (red + 4)) / 255) << 11) |
(((63 * (green + 2)) / 255) << 5) |
((31 * (blue + 4)) / 255);
}
void tftZmienne() {
gaugeBack.createSprite(240, 240);
gaugeBack.fillSprite(TFT_TRANSPARENT);
gaugeBack.pushImage(0, 0, 240, 240, (uint16_t *)Startowa);
gaugeBack.loadFont(mr2font24);
gaugeBack.setTextDatum(MC_DATUM);
gaugeBack.drawFloat(losowa, 1, 5, 5);
gaugeBack.pushSprite(0, 0, TFT_TRANSPARENT);
}
void Task1code( void * pvParameters )
{
for(;;)
{
Wyswietlanie();
vTaskDelay(1);
}
vTaskDelete(NULL);
}`
Beta Was this translation helpful? Give feedback.
All reactions