neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
931 stars 189 forks source link

CustomPrompt example not updating #376

Open danielkucera opened 2 years ago

danielkucera commented 2 years ago

The example says:

//this prompt will count seconds and update himself on the screen.

but it is not updating, It still shows 0 Looks like the function changed is not called: https://github.com/neu-rah/ArduinoMenu/blob/master/examples/CustomPrompt/CustomPrompt/CustomPrompt.ino#L40

Am I missing something?

danielkucera commented 2 years ago

I've changed it to this and it works:

  virtual void clearChanged(const navNode &nav,const menuOut& out,bool sub) {
    dirty = false;
    t=millis()/1000;
    if (last!=t) {
      dirty = true;
    }
  }

Is that a correct way?

sirias52 commented 1 year ago

i have this problem

CustomPrompt:40:16: error: conflicting return type specified for 'virtual bool altPrompt::clearChanged(const Menu::navNode&, const Menu::menuOut&, bool)' virtual bool clearChanged(const navNode &nav,const menuOut& out,bool sub=true) {

neu-rah commented 1 year ago

a pull request would be very welcomed :D