Maximum value of a variable?

Official forum for open source FreePIE discussion and development.
Post Reply
WestleyTwain
One Eyed Hopeful
Posts: 13
Joined: Mon Jan 29, 2018 4:41 pm

Maximum value of a variable?

Post by WestleyTwain »

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?
Jabberwock
Cross Eyed!
Posts: 197
Joined: Mon Mar 02, 2015 3:58 pm

Re: Maximum value of a variable?

Post by Jabberwock »

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

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

Watch the variable.
WestleyTwain
One Eyed Hopeful
Posts: 13
Joined: Mon Jan 29, 2018 4:41 pm

Re: Maximum value of a variable?

Post by WestleyTwain »

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

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

Watch the variable.
works like a charm. Thanks!
Jabberwock
Cross Eyed!
Posts: 197
Joined: Mon Mar 02, 2015 3:58 pm

Re: Maximum value of a variable?

Post by Jabberwock »

Glad I could help!
Post Reply

Return to “FreePIE”