Hi Dave,
I've used the tcMenu with i2c LCD & 3 button input on a Mega.
I'm also using a SPI datalogger to log some system temperatures to a SD card.
I use the tcMenu to set the time duration between data saving events like in the code below.
void CALLBACK_FUNCTION onDataSaveInterval(int id) {
menuDataSaveId = taskManager.scheduleFixedRate(menuDataSave.getCurrentValue()*60, dataLogging, TIME_SECONDS);
Serial.print("DataSaveInterval from Callback " ); // for debug
Serial.println(menuDataSave.getCurrentValue());
Serial.print("menuDataSaveId Callback ");
Serial.println(menuDataSaveId);
}
What I see from the serial debug is that the data is being saved for every iteration that one increases or reduces the value.
I did check out Serial.println(taskManager.checkAvailableSlots(debugData,sizeof(debugData)));, but that does not help me a lot.
I've also tried the following, but it still seems to be logging for every instance I changed the menu item.
void CALLBACK_FUNCTION onDataSaveInterval(int id) {
// Cancel current scheduling first, then reschedule. menuDataSaveId
if (appMode != APP_SETUP_MODE) { // Cannot cancel task in Setup mode as ID's are only allocated at this time
taskManager.cancelTask(menuDataSaveId);
Serial.print("Cancel menuDataSaveId = ");
Serial.println(menuDataSaveId);
}
menuDataSaveId = taskManager.scheduleFixedRate(menuDataSave.getCurrentValue()*60, dataLogging, TIME_SECONDS);
Serial.print("DataSaveInterval from Callback " );
Serial.println(menuDataSave.getCurrentValue());
Serial.print("menuDataSaveId Callback ");
Serial.println(menuDataSaveId);
}
Is there a way that one can see a list of the names of the "functions" scheduled?