| 78 | } |
| 79 | |
| 80 | void IS_Motion::update() |
| 81 | { |
| 82 | if(calibrated) |
| 83 | InterruptSensor::update(); |
| 84 | else |
| 85 | if(millis()>timer+30000) |
| 86 | { |
| 87 | calibrated=true; |
| 88 | |
| 89 | //get current status of motion sensor by calling parent class's init() routine - no need to duplicate it here! |
| 90 | setInterruptPin(getInterruptPin()); |
| 91 | InterruptSensor::init(); |
| 92 | |
| 93 | if (debug) |
| 94 | { |
| 95 | Serial.println(F("IS_Motion: Motion Sensor Calibration Finished")); |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | } |