Code Monkey home page Code Monkey logo

Comments (6)

ropg avatar ropg commented on May 26, 2024 1

That said: I am working on a way to include your own function into the loops of M5ez. And then in there you could see if 10 seconds have passed and do something. That is probably a few weeks out though.

Hmmm, maybe I could even do ez.at(moment, yourFunction) and ez.every(milliseconds, yourFunction) and keep a list of registered functions and when to call them. That would be spiffy and not too hard...

(But to then have them change the contects of the menu... Hmmm, I would have to think about that one, because the menu may well be only in scope of a single function at that point.)

from m5ez.

 avatar commented on May 26, 2024 1

I set the caption of a menu item from a xTaskCreate function but wont show the new caption until i change the selected menu item or i select the menu item.
Is it possible to call a function to redraw the menu or to change the selected menu item ?

Can i set a static ip address for wifi connection ?

from m5ez.

ropg avatar ropg commented on May 26, 2024

from m5ez.

 avatar commented on May 26, 2024

You are right, i got it working now.
I made a task with xTaskCreate and i loop with while (true) with delay.

Thank you for your help.

from m5ez.

ropg avatar ropg commented on May 26, 2024

Good point. I will make this change affect the menu immediately. Cannot think of a quick workaround right now.

Should be back making some changes to M5ez sometime soon after I have put the finishing touches on ezTime.

from m5ez.

ropg avatar ropg commented on May 26, 2024

M5ez 2.0.0 is out. It allows for you to add a task to its loop. Use ez.addEvent to add your function. This function needs to take no arguments and return a uint16_t that holds in how many milliseconds it should be executed again. So returning 1000 would create a function that runs once a second. Simply add a wrapper function if the function you'd like to run does not return a number like that.

(Do note that for some applications, using a FreeRTOS task (or some combination of that and a function in M5ez's loop) may still be the best way to go.

Also menu captions should now update immediately, and you can add a tab (\t) to split between a part of the label that alligns left and a part that alligns to the right side of the menu caption.

from m5ez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.