Hey guys, first of all, I want to apologize for all types of wrong grammar, I'm not a native speaker ...
So, here's my problem:
Currently I'm working on a script to print a text on an 20x4 LCD, which is stored in the Arduino Uno's Flash (PROGMEM).
First I used the F() - macro, but then I decided to insert a "language-file".
I better Show you the code:
#include <avr/pgmspace.h>
#include<LiquidCrystal.h>
void setup()
{
// SOME CODE
FUNCTION_STARTUP(false);
}
void Loop()
{
// SOME CODE
}
// ANOTHER TAB
// Language
PROGMEM const prog_char PROGMEM_LCD_FAILED_SHUTDOWN_01[] = " System has not been";
PROGMEM const prog_char PROGMEM_LCD_FAILED_SHUTDOWN_02[] = " shut down properly.";
PROGMEM const prog_char PROGMEM_LCD_FAILED_SHUTDOWN_03[] = "Do not shut down the";
PROGMEM const prog_char PROGMEM_LCD_FAILED_SHUTDOWN_04[] = "system while working";
// and so on ....
// ANTOTHER TAB
// Startup
void FUNKTION_STARTUP(boolean VIA_STATUS)
{
if (VIA_STATUS)
{
// SOME CODE
}
else
FUNKTION_WRITE(1, PROGMEM_LCD_FAILED_SHUTDOWN_01,
1, PROGMEM_LCD_FAILED_SHUTDOWN_02,
1, PROGMEM_LCD_FAILED_SHUTDOWN_03,
1, PROGMEM_LCD_FAILED_SHUTDOWN_04);
}
// ANOTHER TAB
// Write on LCD
void FUNKTION_WRITE(boolean USE_LINE_0, const char LINE_0[21], boolean USE_LINE_1, const char LINE_1[21], boolean USE_LINE_2, const char LINE_2[21], boolean USE_LINE_3, const char LINE_3[21])
{
if (USE_LINE_0)
{
lcd.setCursor(0, 0); lcd.print(LINE_0);
}
if (USE_LINE_1)
{
lcd.setCursor(0, 1); lcd.print(LINE_1);
}
if (USE_LINE_2)
{
lcd.setCursor(0, 2); lcd.print(LINE_2);
}
if (USE_LINE_3)
{
lcd.setCursor(0, 3); lcd.print(LINE_3);
}
}
So, that's what I got so far.
When the message should finally be printed on the LCD, there are only weird charakters.
I have really no clue, what's wrong with my script so far, would be really great, if someone could help me!
Short note:
The Hardware is really ok, because I ran the code without language from PROGMEM (just the text in the FUNKION_WRITE), and it worked fine.