Possible to change sensor value precision in BtnCmd?
-
I've been using BtnCmd to control my pen plotter. Very easy to put a nice UI together and use!
Is it possible somehow to set a variable's displayed precision? I have the following in config.g:
M308 S0 P"io3.in" Y"linear-analog" A"Pen pressure" F1
And I am using it to display the sensor value in BtnCmd using:
sensors.analog[0].lastReading
Which works fine. However, I'd like to display the value as an integer if possible instead of a decimal value. Is there any way of doing this? I tried multiplying the value by 1 and adding 0 using the OM value expression input, but neither of those worked. I even thought about just putting a blank panel over the decimal numbers to hide them, but as the number changes the location of the decimal point moves. Or is there a way to set precision using config.g?
Any assistance would be appreciated!
-
@usinjin
In the OM Value Epression section putfloor(##VALUE##+0.5)
This will round to the nearest whole number
-
@OwenD Perfect. Should have thought about floor/ceiling funcs. Thank you!