Message |
|
Thanks Dave,
I've done so, but now get the following error with the exact same file after regenerating the code on the Designer.
C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `appendChar(char*, char, int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `dpToDivisor(int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `valueToSignificantPlaces(unsigned long, bool)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `fastltoa_mv(char*, long, long, char, int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `ltoaClrBuff(char*, long, unsigned char, char, int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `fastltoa(char*, long, unsigned char, char, int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here C:\ARDTemp\libraries\IoAbstraction\TextUtilities.cpp.o (symbol from plugin): In function `appendChar(char*, char, int)': (.text+0x0): multiple definition of `fastftoa(char*, float, int, int)' C:\ARDTemp\libraries\tcMenu\tcUtil.cpp.o (symbol from plugin).text+0x0): first defined here collect2.exe: error: ld returned 1 exit status
|
|
|
Hi Dave,
Thanks for the note.
I've upgraded the Designer and built a basic menu for a DFR board installed on a Mega 2560 to test. I do however keep on getting the below error & even rolled back the tcMenu library to 2.4.
What could be the issue?
"C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp: In member function 'void MenuManager::performDirectionMove(bool)': C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:57:78: error: no matching function for call to 'SwitchInput::changeEncoderPrecision(int, int&, int, bool)' isWrapAroundEncoder(editableItem)); ^ In file included from C:\..\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:306:0, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.h:9, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:7: C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint16_t, uint16_t) void changeEncoderPrecision(uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(0, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate expects 2 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(slot, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate expects 3 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t, bool, int) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue, bool rollover, int step); ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate expects 5 arguments, 4 provided C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp: In member function 'void MenuManager::stopEditingCurrentItem(bool)': C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:206:78: error: no matching function for call to 'SwitchInput::changeEncoderPrecision(int, int&, int, bool)' isWrapAroundEncoder(editableItem)); ^ In file included from C:\..\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:306:0, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.h:9, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:7: C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint16_t, uint16_t) void changeEncoderPrecision(uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(0, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate expects 2 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(slot, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate expects 3 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t, bool, int) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue, bool rollover, int step); ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate expects 5 arguments, 4 provided C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp: In member function 'void MenuManager::setupForEditing(MenuItem*)': C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:302:75: error: no matching function for call to 'SwitchInput::changeEncoderPrecision(int, uint16_t, int, bool)' isWrapAroundEncoder(currentEditor)); ^ In file included from C:\..\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:306:0, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.h:9, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:7: C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint16_t, uint16_t) void changeEncoderPrecision(uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(0, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate expects 2 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(slot, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate expects 3 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t, bool, int) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue, bool rollover, int step); ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate expects 5 arguments, 4 provided C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:309:107: error: no matching function for call to 'SwitchInput::changeEncoderPrecision(int, int&, int, menuid_t)' switches.changeEncoderPrecision(0, range, editableItem->getPartValueAsInt(), editableItem->getId()); ^ In file included from C:\..\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:306:0, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.h:9, from C:\..\Arduino\libraries\tcMenu\src\tcMenu.cpp:7: C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint16_t, uint16_t) void changeEncoderPrecision(uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(0, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:553:7: note: candidate expects 2 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue) { changeEncoderPrecision(slot, precision, currentValue, false, 1); } ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:563:10: note: candidate expects 3 arguments, 4 provided C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate: void SwitchInput::changeEncoderPrecision(uint8_t, uint16_t, uint16_t, bool, int) void changeEncoderPrecision(uint8_t slot, uint16_t precision, uint16_t currentValue, bool rollover, int step); ^~~~~~~~~~~~~~~~~~~~~~ C:\..\Arduino\libraries\IoAbstraction\src/SwitchInput.h:575:7: note: candidate expects 5 arguments, 4 provided
|
|
|
Hi Dave,
I did select the Uno. Both the Uno & Full give me the same error.
|
|
|
I've used the tcMenu Designer to create a menu and code for me.
Upon compiling for an Uno, the Arduino IDE (Ver 1.8.19) gives me the following error:
".....\tcMenuLiquidCrystal.cpp: In member function 'void LiquidCrystalRenderer::renderMenuItem(uint8_t, MenuItem*)': tcMenuLiquidCrystal.cpp:201:31: error: 'JUSTIFY_TEXT_RIGHT' was not declared in this scope menuValueToText(item, JUSTIFY_TEXT_RIGHT); ^~~~~~~~~~~~~~~~~~ tcMenuLiquidCrystal.cpp:201:9: error: 'menuValueToText' was not declared in this scope menuValueToText(item, JUSTIFY_TEXT_RIGHT); ^~~~~~~~~~~~~~~""
and then exists.
Can you please assist or advise what could be wrong?
Regards
|
|
|
forgot the "Is it correct?"
|
|
|
Thanks a mill Dave,
I shall have a look at the suggestions.
Is the high level logic in the second code posting, to cancel the previous scheduled task before scheduling the next?
|
|
|
Here is a screenshot of the Serial Monitor:
menuDataSaveId Callback 5
DataSaveInterval from Callback 3
menuDataSaveId Callback 6
Save to EEPROM
dataLogging 6 02/04/2021;15:34:43;314;315;298
dataLogging 6 02/04/2021;15:36:29;315;315;297
dataLogging 6 02/04/2021;15:36:32;308;309;293
dataLogging 6 02/04/2021;15:37:00;306;305;289
dataLogging 6 02/04/2021;15:37:04;307;307;291
dataLogging 6 02/04/2021;15:37:32;316;317;298
|
|
|
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?
|
|
|
Thanks Dave, I understand and shall try accordingly.
|
|
|
Hi Dave,
Thanks for the library & assistance you provide to all.
I am new to this library and have spent quite a bit of time on trying to understand it, but am missing something.
I have an Arduino Mega, 20x4 LCD on i2C and 3 buttons with pull-up logic and some menu items running. I've also implemented the eeprom storage and it all works well.
The menu now displays and I've been able to take over the display and show display some system parameters from sensors on the LCD on the display as explained in the "takeOverDisplay" example. My challenge is that when I schedule the "Display Sensors function" that should update the display only when the menu is inactivated, the display is distorted with a mix of the sensor display and the menu.
How do I test if the menu is active and ensure that the "Display Sensors function" does not run while the menu is open?
Thanks in advance for your assistance.
Regards,
Jaco
|
|
|
|
|