how do a get a maximum value of a power calculation
can it be something like this??
var mPower = 0;
if (power > mPower) {
mPower = power;
}
??
how do a get a maximum value of a power calculation
can it be something like this??
var mPower = 0;
if (power > mPower) {
mPower = power;
}
??
I don't think anyone understands your question.
The code you posted above will result in `mPower` having the maximum value of `power` after the conditional. You just need to be sure that this code is invoked when `power` is updated.
thanks a lot travis now i have this running!
if (mTimerRunning == true && power > maxPower){
maxPower = power.toNumber();
mPower.setData(maxPower.toNumber());
}
i got another easy question when you want 30 avg
whats the correct way??
avPower = avPower + ((power - avPower) / 30*120).toNumber();
or
avPower = avPower + ((power - avPower) / 30).toNumber();
forget last question sorry