Hallo , ich habe folgendes Problem mit der PROGMEM Funktion
im ersten Fall , übergebe ich an die Stringvariable LCDText[0]=Loks[4]; (direkt den Wert "4" ,funktioniert)
ersetze ich die "4" durch die Variable "aktiv" ,die ebenfalls den Wert 4 besitzt , funktioniert es nicht
( die Stringvariable LCDText[0] bleibt leer ).
Weiß vielleicht jemand weiter ?
#include <avr/interrupt.h>
#include <avr/io.h>
#include <LiquidCrystal.h>
#include <avr/pgmspace.h>
#define NUM_LCD 4
LiquidCrystal lcd[NUM_LCD] = {
LiquidCrystal(23, 24, 25, 29, 30, 31, 32),
LiquidCrystal(23, 24, 26, 29, 30, 31, 32),
LiquidCrystal(23, 24, 27, 29, 30, 31, 32),
LiquidCrystal(23, 24, 28, 29, 30, 31, 32)};
prog_char* Loks[64] PROGMEM={
"-------","Adler","AE3/6","AE 8/14","BR01","BR03","BR03 Stroml", "BR05","BR10","BR17","Rheingold","BR18.1","BR38","BR41","BR50","BR52 grau","BR53","BR80","BR81","BR85",
"BR86","BR89","BR93","BR96","BR120","BR194", "BR212Trak","BR360","CargoSpri","DR212","E04","E19 blau","E19 Rot","E40","E52","E69","E70","E91","E103","E118b ",
"E120","E151","Geisling","Heizerlok","Koef","Krokodil","Museumlok","ICE","Pendolino","Rottenkraft","Schienenbus","SVT137","Torflok","Unicef","V36","V100.20","VT11.5","V160 grau","V160 rot","V221",
"Zeppelin","----","----","----" };
int aktiv=4;
String LCDText[5];
void setup(){
for (int i = 0; i < NUM_LCD; i++){
lcd[i].begin(20, 4);
lcd[i].clear();
}
LCDText[0]=Loks[4]; // funktioniert in dem Fall erscheint BR01 auf dem Display
lcd[1].setCursor(2, 0);
lcd[1].print(LCDText[0]);// Ausgabe LCD 1
LCDText[0]=Loks[aktiv]; // funktioniert nicht
lcd[0].setCursor(2, 0);
lcd[0].print(LCDText[0]);// Ausgabe LCD 0
}
void loop(){
}