FrSky
FrSky copied to clipboard
Recommended frequency to call hub.handle()
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?
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.