Meant to be Seen
https://www.mtbs3d.com/phpbb/

Maximum value of a variable?
https://www.mtbs3d.com/phpbb/viewtopic.php?f=139&t=22736
Page 1 of 1

Author:  WestleyTwain [ Sat Mar 10, 2018 2:20 am ]
Post subject:  Maximum value of a variable?

Sometimes I see that even though the wiimote is standing still, its acceleration is sometimes more than 9.8, which should not be possible. I want to watch the wiimote[0].acceleration.z output over time and see what the biggest number so far has been. Occasionally it'll even be a 2 digit number, but only for a frame or two.

How can I watch the maximum output of a variable?

Author:  Jabberwock [ Sat Mar 10, 2018 3:03 pm ]
Post subject:  Re: Maximum value of a variable?

Declare a gobal variable, as described here:
https://github.com/AndersMalmgren/FreePIE/wiki/Scripting

If the reported input is higher than the variable, put it in the variable.

Watch the variable.

Author:  WestleyTwain [ Sat Mar 10, 2018 4:57 pm ]
Post subject:  Re: Maximum value of a variable?

Jabberwock wrote:
Declare a gobal variable, as described here:
https://github.com/AndersMalmgren/FreePIE/wiki/Scripting

If the reported input is higher than the variable, put it in the variable.

Watch the variable.


works like a charm. Thanks!

Author:  Jabberwock [ Sun Mar 11, 2018 3:46 am ]
Post subject:  Re: Maximum value of a variable?

Glad I could help!

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/