MCPcopy Create free account
hub / github.com/arkhipenko/TaskScheduler / OnEnable

Method OnEnable

examples/Scheduler_example21_OO_Callbacks/Calculator.cpp:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30extern int pins[];
31
32bool Calculator::OnEnable() {
33 Serial.print(millis()); Serial.print(":\t");
34 Serial.println("CalcEnable: OnEnable");
35 Serial.println("Activating sensors");
36
37 StatusRequest* sr = getStatusRequest();
38 iNS = sr->getCount();
39
40 distance = 0;
41 for (int i = 0; i < iNS; i++) {
42 SuperSensor *s = new SuperSensor( iS, pins[i], this, sr);
43 s->setId(i + 1);
44 s->begin();
45 s->restartDelayed();
46 }
47
48 return true;
49}
50
51void Calculator::OnDisable() {
52 if ( timedOut() ) {

Callers

nothing calls this directly

Calls 5

millisFunction · 0.85
getCountMethod · 0.80
setIdMethod · 0.80
restartDelayedMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected