Project source at lucaspcamargo/str2progmem

This script allows you to parse text files into PROGMEM blocks for Arduino, generating source and header files automatically.

It also works for generic C usage by setting the env var TARGET to generic.


Given this string list:

# strings_en.txt
Welcome to the Menu
I ¬9D NY!

You can invoke the script as such:

./str2pgmspace strings_en.txt str_en

This will generate the files str_en.cand str_en.h. Then, after incluing the header, the strings can be used as such:

// On serial port
Serial.println( PGMSTR(STR_EN_GET(0)) );

// On an LCD
lcd.println( PGMSTR(STR_EN_GET(1)) );

See this post for more info.