Hallo,
ich steuere gerade mit einem Arduino Mega 2560 ein TFT mit dem Chipsatz RM68140 an (3.5").
Ab einer gewissen Anzahl von Bildern im Flash Speicher treten regelmäßige Darstellungsprobleme auf. (siehe Bild)
Verringert man die Anzahl der darzustellenden Elemente, ohne die includes anzupassen, treten beim selben Bild keine Darstellungsprobleme mehr auf. (siehe Bild)
Ich habe mittlerweile schon etwas gelesen, dass pgm_get_far_address() bei größeren Adressbereichen genutzt werden muss und, dass es eine Obergrenze an Arrayelementen gibt, das hat allerdings bisher auch nicht weitergeholfen.
TFT wurde bereits gegen einen anderen ausgetauscht und Arduino Mega ebenfalls.
Hier der Code:
#include "MCUFRIEND_kbv.h"
MCUFRIEND_kbv tft;
#define LOWFLASH (defined(__AVR_ATmega328P__) && defined(MCUFRIEND_KBV_H_))
#include "icons/plus.h"
#include "icons/homing.h"
#include "icons/minus.h"
#include "icons/numbox.h"
/*
#include "icons/alarm.h"
#include "icons/bed_tab.h"
#include "icons/compressor_on.h"
#include "icons/compressor_off.h"
#include "icons/data_tab.h"
#include "icons/error.h"
#include "icons/laser_off.h"
#include "icons/laser_on.h"
#include "icons/pf_down.h"
#include "icons/pf_up.h"
#include "icons/pumpfan_off.h"
#include "icons/pumpfan_on.h"
#include "icons/numbox_small.h"*/
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define GREY 0x8410
#define ORANGE 0xE880
void setup()
{
Serial.begin(9600);
uint16_t ID = tft.readID();
Serial.print(F("ID = 0x"));
Serial.println(ID, HEX);
tft.begin(ID);
tft.setRotation(1);
}
void loop(void)
{
int x, y;
tft.fillScreen(WHITE);
x = 0; y = 20;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x = 389; y = 20;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x = 389; y = 122;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x = 304; y = 105;
tft.setAddrWindow(x, y, x + 80 - 1, y + 80 - 1);
tft.pushColors((const uint8_t*)plus, 80 * 80, 1);
x = 225; y = 150;
tft.setAddrWindow(x, y, x + 80 - 1, y + 80 - 1);
tft.pushColors((const uint8_t*)minus, 80 * 80, 1);
x = 130; y = 30;
tft.setAddrWindow(x, y, x + 211 - 1, y + 69 - 1);
tft.pushColors((const uint8_t*)numbox, 211 * 69, 1);
x = 1; y = 140;
tft.setAddrWindow(x, y, x + 211 - 1, y + 69 - 1);
tft.pushColors((const uint8_t*)numbox, 211 * 69, 1);
x = 1; y = 230;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x += 97;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x += 97;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x += 97;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
x += 97;
tft.setAddrWindow(x, y, x + 90 - 1, y + 90 - 1);
tft.pushColors((const uint8_t*)homing, 90 * 90, 1);
delay(50000);
}
Die genutzten Icons befinden sich im Anhang.
Kann mir jemand einen Tipp geben, auf was geschaut werden kann? Ich habe mittlerweile keine Idee mehr.
homing.h (76.8 KB)
minus.h (60.7 KB)
numbox.h (138 KB)
plus.h (60.7 KB)