I understand the AnalogMenuItem is unsigned 16bits Max value 65535.
When I increase the value beyond 15 bits 32767 the value displayed becomes negative and starts at 0.
The value 32768 will display as -0 on the LCD but printing it to the serial port it is correct.
#include "src/CYCLE_menu.h"
uint16_t Cycles = 0;
void setup() {
setupMenu();
Serial.begin(115200);
}
void loop() {
taskManager.runLoop();
}
void CALLBACK_FUNCTION onCycle(int id) {
// TODO - your menu change code
}
void CALLBACK_FUNCTION onIncCycle(int id) {
// TODO - your menu change code
Cycles=32768;
menuCYCLE.setCurrentValue(Cycles,true);
Cycles = menuCYCLE.getCurrentValue();
Serial.println(Cycles);
}