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

tcMenu Arduinio library » LargeFixedNumbers example code plz

Author: Gcc26
18/11/2020 10:18:05
My C skills are not up to understading the info given on the webpage dealing with menu types. Ie enum, analog, boolean. I have looked through the examples without finding how to access a menu largefixed number. I did only need to use analogue. But now I'm wondering what I need to learn about LFN.

Author: davetcc
18/11/2020 17:54:48
You'll be glad to know that we are working on the menu type documentation at this very moment! Will be pushed to the site in the next week hopefully.

Take a look at the roadmap and you'll see that most of the tasks in the next couple of cycles are to do with documentation and site improvements, and if we need to make the cycle longer because we find more holes in the documentation, we will. Our focus in now stability and usability. If you have any other areas that are not clear, we'd be glad to hear of them!

https://www.thecoderscorner.com/products/product-roadmap/

Author: davetcc
18/11/2020 18:12:53
For the time being until the documentation is updated, you can think of large number support as being for numbers well outside the range that you could edit with a rotary encoder.

For example lets say you needed something that represented all frequencies from 0 to 1Mhz, you could not present that with a rotary encoder. Instead, with large fixed number you can edit those one digit at at time, and the are stored in BCD format of up to 12 digits.

Here's a few examples for the time being, better docs coming soon.

LargeFixedNumber* num = menuItem.getLargeNumber();

// To read the latest as a floating point
float flt = num->getAsFloat()

// To read the latest as a whole and fraction
bool neg = num->isNegative()
uint32_t whole = num->getWhole()
uint32_t fr = num->getFraction()

// to set a new value from a float
num->setFromFloat(value);

// to set as a whole and fraction
num->setValue(whole, fraction, isNegative);

Author: davetcc
22/11/2020 16:29:33
The documentation was today updated, and a new page has been created that documents large number support.

https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-item-types/largenum-menu-item/

In fact this update was a major update, really cleaning up the whole tcMenu section of the site.




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