Menu for Display

Hi Andrea

Glad to read that you still work with m2tklib on your menu. Hope that all required functionality is included.

My devices numeration start from 0 until 31 ... do you know a simply way for display this stored value into into the menu ?

The following examples assume, that the device is in a global variable "device"
uint8_t device;

Method 1:
Use M2_U8NUM(xyz, "r1", &device) with a read only flag if you only want to display the value.

Method 2:
char linebuf[30];
...
sprintf(linebuf, "blabla dev:%d more blabla", device);
Use M2_LABEL(xyz, NULL, linebuf)
The full line is rendered into a buffer of sufficient size. Disadvantage: "linebuf" needs to be updated when device is changed.

Method 3:
Use M2_LABELFN() similar to Method 2, but the callback procedure returns the string. See Wiki... Removes the disadvantage from above.

Method 4:
You can always do a LiquidCrystal.print directly on the screen. This is not a problem as long as your output does not overlap the menues. Usually you want this output only if a selected root element is active (similar to the problem with the initial splash screen)

Oliver