Copy a value from (Scale.get_units ) ;

Hi all

Maybe a small question for Arduino programmers but for me, 'grandpa jaap', difficult
For an application I want the absolute max value know for a small scale unit.
I use the LCD ( LCDi2c )
I quote the LCD.print (Scale.get_units) ; call and try to copy this value to a variable called "value Copy'.
Value copy is assigned as Float and presets with 0. … there are no errors ..

The returned value of lcd.print (Scale.get_units(), 4 ); is show on the LCD and is OK.

It Returnes

My problem is how to copy the float value of ‘get_units’ to an variable, (Value _copy)

As I used ( value_copy) = ( get_units ); returned Value_copy is always 0.000 So wich value and where is the real value

Also tried without ( ) .

As I say, I was over 40 years an Microchip asm programmer, Now ( try ) learning the C++ language..

I must take a copy to calculate the max presure value ( value on display on the beneath ‘max druk’ ) but wich value do I need and how can I copy this ‘get_units value’??

Met vriendelijke groet, Kind regards, Mit freundlichen Grüßen,​​​​

"Grandpa jaap"
​​

get_units seems to be a function you call on the Scale object. so you need to do

float value = Scale.get_units(); // <== with () for the function call

you do so if you do

but here you noted the call without the ()

➜ use () for function call

thank you for reply, I already solved this ...
Thank you for the suggestions !!

"grantpa jaap"

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.