Hi All!
I'm love the tcMenu lib and thank you so much for creating it!
I gives hobby/amateur programmers the ability to create something which would have taken me probably to long or even impossible (for me).
It is with this mindset that come to the following question.
How should I use ListRuntimeMenuItem to create a dynamic list of items during runtime(to select from).
I know it mainly my lack of understanding why i can't use is properly.
The main thing i don't understand is how to handle the "V" parts in the code ( buffer[0] = 'V'; buffer[1]=0
.
I cannot find any examples how to use it in the "example" folder.
I did read the documentation but i'm not getting all of it (or how it fits together, sorry).
I hope that there is anyone out there that can help me....
This is the code stub created automaticly for handling the menu
// see tcMenu list documentation on thecoderscorner.com
int CALLBACK_FUNCTION fnDevicesRtCall(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int bufferSize) {
switch(mode) {
case RENDERFN_INVOKE:
Serial.println("Index selected: " + String(row));
// TODO - your code to invoke goes here - row is the index of the item
return true;
case RENDERFN_NAME:
// TODO - each row has it's own name - 0xff is the parent item
ltoaClrBuff(buffer, row, 3, NOT_PADDED, bufferSize);
return true;
case RENDERFN_VALUE:
// TODO - each row can has its own value - 0xff is the parent item
buffer[0] = 'V'; buffer[1]=0;
fastltoa(buffer, row, 3, NOT_PADDED, bufferSize);
return true;
case RENDERFN_EEPROM_POS: return 0xffff; // lists are generally not saved to EEPROM
default: return false;
}
}