OTA Why callbacks in Setup void ?
Posted: Sat Apr 09, 2016 12:01 pm
Hi guys,
Going to ask a silly one here, In the basicOta sketch, why are the callbacks located within the setup subroutine?
Can they be placed outside of setup or is there a specific reason. I can understand that ArduinoOTA.begin(); needs to be there, but don't quite get why a separate callback such as
ArduinoOTA.onProgress( {
Serial.printf("Progress: %u%%\n", (progress / (total / 100)));
});
is located within the setup scope.
Cheers
Dans
Going to ask a silly one here, In the basicOta sketch, why are the callbacks located within the setup subroutine?
Can they be placed outside of setup or is there a specific reason. I can understand that ArduinoOTA.begin(); needs to be there, but don't quite get why a separate callback such as
ArduinoOTA.onProgress( {
Serial.printf("Progress: %u%%\n", (progress / (total / 100)));
});
is located within the setup scope.
Cheers
Dans