Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Example for getTime()

Author: cerberosbln
16/06/2021 08:37:43
I've some trouble to get simply the values for hour, minutes and seconds in seperate variables from the time storage object. Are there some examples? Searching the forum and docs didn't help me.

Author: davetcc
16/06/2021 09:32:31
Hi there, take a look at:

https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-item-types/editabletext-menu-item/ especially the section on "Working with complex editable items in code" which covers time storage.

Also you can see: https://www.thecoderscorner.com/ref-docs/tcmenu/html/class_time_formatted_menu_item.html

Generally, when you bring up the properties for a menu item in the UI, there's a link at the top to the online documentation for that menu item. Let us know if we can make the documentation easier to navigate around this, we've had a few goes at tidying it up now but user feedback is always the best way to improve it.

But essentially, you access them from the time structure that is returned, for example:

TimeStorage t = menuTime.getTime();
int hours = t.hours;
int mins = t.minutes;


Author: cerberosbln
16/06/2021 13:35:40
Thanks, works perfect smilie




Register / Login  |  Desktop view  |  Jump to top of page