Try to use char pointer notation (char *) instead of array notation (char[]) in structure declaration:
struct commands
{
int cmd;
char* descr;
};
- OR -
use struct declaration as-is, but change the array initialization like below:
commands cmds[] =
{
{16, {"Hammond Organ"}},
{17, {"Percussive Organ"}},
{18, {"Rock Organ"}},
{ 0, {""}} // end of list marker
};
Additionally, it seems that it always should be written as:
struct commands cmds[] =
{
// here your code
};
If you have disabled warnings in your compiler, enable them again - and try to write program the way that you will newer receive warnings.
Thanks for your answer. It helped me a lot.
There must be something wrong with the simulator (Simulator for Arduino - version 1.11E Designed by Virtronics). In the meantime I received the Mega 2560 board and both char pointer notation (char ) and array notation (char[]) work well with the board. The compiler (Arduino IDE v. 1.8.10) really produces warnings: ISO C++ forbids converting a string constant to 'char' [-Wwrite-strings]. Perhaps the simulator is more meticulous than the compiler and therefore refuses to work with a code thar generates warnings.