FrSky icon indicating copy to clipboard operation
FrSky copied to clipboard

Recommended frequency to call hub.handle()

Open ululi1970 opened this issue 3 years ago • 1 comments

Is there a recommended frequency to call hub.handle()?

That is, in

` #include <Sport.h> SportHub hub(SENSOR_ID, PIN); #define INTERVAL = XXX //... unsigned long previous = 0;

void setup() {//... previous = millis(); //...

}

void loop(){ // calculate new values for sensor values

if (millis()-previous > INTERVAL) { hub.handle(); previous = millis(); //... } `

what would be the minimum value for INTERVAL?

ululi1970 avatar Apr 27 '21 00:04 ululi1970

The hub.handle(); should be called very often, about 1000Hz. Calling it every loop run would be best. The method is very light and does not use much cpu time.

RealTadango avatar Apr 27 '21 18:04 RealTadango