Salve, chiedo venia per la mia scarsa preparazione in materia ma mi sono trovato di fronte ad un nuovo problema e necessito di un aiutino per oltrepassare lo scoglio incontrato....
All'interno del mio programma io creo due set di caratteri speciali da inviare ad un LCD 4x40... un set mi consente di scrivere delle lettere, mentre l'altro mi consente di scrivere dei numeri e all'occorrenza direttamente dal software carico con lcd.createChar il set che mi occorre...
Il tutto risultava funzionante, ma come ho già scritto (E risolto in parte) in un altro post mi occorre maggior memoria RAM libera altrimenti il tutto si blocca.
Uno dei consigli (e ringrazio Leo72 per questo) è stato quello di caricare i font direttamente in flash con PROGMEM e qui si complica il tutto... ho letto i vari reference ed esempi sull'utilizzo di questa funzione ma mi da sempre degli errori...
Di seguito allego il codice prima della modifica.... dopo la modifica... e l'errore che mi sta dando... se qualche anima pia mi potesse dire come risolvere, o cmq cosa stà dando fastidio al compilatore... gliene sarei grato in eterno.....
byte a1[8] = // array to make an arrow pointing up
{
B00000,
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000
};
byte a2[8] = // array to make an arrow pointing up
{
B00000,
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte a3[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111,
B00111
};
byte a4[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte a5[8] = // array to make an arrow pointing up
{
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte a6[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000
};
byte a7[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000,
B00000
};
byte a8[8] = // array to make an arrow pointing up
{
B11000,
B01100,
B00110,
B11111,
B11111,
B00110,
B01100,
B11000
};
byte b1[8] = // array to make an arrow pointing up
{
B00111,
B01111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte b2[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B00011,
B00011,
B00011,
B00011,
B11111,
B11111
};
byte b3[8] = // array to make an arrow pointing up
{
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte b4[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111,
B00111
};
byte b5[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B11111,
B11111,
B11111,
B00000,
B00000,
B00000
};
byte b6[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B00000,
B00000,
B00000,
B00000,
B00000
};
byte b7[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11110,
B11100
};
byte b8[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111
};
Questo era il codice dei due set di caratteri.... ogni array è stato modificato come segue....
PROGMEM const byte a1[8] = // array to make an arrow pointing up
{
B00000,
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000
};
PROGMEM const byte a2[8] = // array to make an arrow pointing up
{
B00000,
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111
};
PROGMEM const byte a3[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111,
B00111
};
PROGMEM const byte a4[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
B11111,
B11111
};
PROGMEM const byte a5[8] = // array to make an arrow pointing up
{
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
PROGMEM const byte a6[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000
};
PROGMEM const byte a7[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B00000,
B00000,
B00000
};
PROGMEM const byte a8[8] = // array to make an arrow pointing up
{
B11000,
B01100,
B00110,
B11111,
B11111,
B00110,
B01100,
B11000
};
PROGMEM const byte b1[8] = // array to make an arrow pointing up
{
B00111,
B01111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
PROGMEM const byte b2[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B00011,
B00011,
B00011,
B00011,
B11111,
B11111
};
PROGMEM const byte b3[8] = // array to make an arrow pointing up
{
B11100,
B11110,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
PROGMEM const byte b4[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111,
B00111
};
PROGMEM const byte b5[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B11111,
B11111,
B11111,
B00000,
B00000,
B00000
};
PROGMEM const byte b6[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B00000,
B00000,
B00000,
B00000,
B00000
};
PROGMEM const byte b7[8] = // array to make an arrow pointing up
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11110,
B11100
};
PROGMEM const byte b8[8] = // array to make an arrow pointing up
{
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111
};
A questo punto il compilatore mi stà dando errore nel momento in cui vado a definire i caratteri per l'cd e cioè in questa parte di codice :
void cambiacarattere(int flagcarattere) {
if (flagcarattere == 1) {
lcd.createChar(0, b1);
lcd.createChar(1, b2);
lcd.createChar(2, b3);
lcd.createChar(3, b4);
lcd.createChar(4, b5);
lcd.createChar(5, b6);
lcd.createChar(6, b7);
lcd.createChar(7, b8);
} else {
lcd.createChar(0, a1);
lcd.createChar(1, a2);
lcd.createChar(2, a3);
lcd.createChar(3, a4);
lcd.createChar(4, a5);
lcd.createChar(5, a6);
lcd.createChar(6, a7);
lcd.createChar(7, a8);
}
}
dandomi come errore:
error: invalid conversion from 'const byte*' to 'uint8_t*'
error: initializing argument 2 of 'void LiquidCrystal::createChar(uint8_t, uint8_t*)'
Scusate se mi sono dilungato ma ho voluto fornire quanti più dati possibili perchè qualcuno (Leo72 vedi di partecipare) mi volesse dare una mano.
Grazieeeeeeeee