Jomelo / LCDMenuLib2

Create a tree menu. Use it with different lcd types / console output / ssh console.
MIT License
251 stars 48 forks source link

Set range in LCDML_addAdvanced #36

Closed Zefram88 closed 5 years ago

Zefram88 commented 5 years ago

As title, is it possible to set a range different than 0-255 in LCDML_addAdvanced?

Jomelo commented 5 years ago

This is no problem.

change the variable type from uint8_t to uint16_t for this variable:
uint8_t g_dynParam = 100;

Scabattoir commented 4 years ago

Hi, my question would connect to this topic: is there a way to make it floating point with a fixed range? Let's say I'd want 0.0 to 5.0 in 0.1 steps. Is it possible?

Jomelo commented 4 years ago

Hello, floating point values are not supported.

Would you use this value as an parameter or for a dynamic menu element?

Parameter: it is not supported but divide your parameter value through 10. (Range 0 - 50/10) Dynamic menu element: you can change the output to your datatype you need.

Scabattoir commented 4 years ago

I'd set a variable with it. For me it is okay just to have it on the display like uint8_t/10.0 and set the variable accordingly but I can't make it show on the screen as the display format is locked. It is the dynParam type I'm talking about.