SuperSensor.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _SUPER_SENSOR_H
  2. #define _SUPER_SENSOR_H
  3. #include "Arduino.h"
  4. #define _TASK_SLEEP_ON_IDLE_RUN // Enable 1 ms SLEEP_IDLE powerdowns between tasks if no callback methods were invoked during the pass
  5. #define _TASK_STATUS_REQUEST // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
  6. #define _TASK_WDT_IDS // Compile with support for wdt control points and task ids
  7. #define _TASK_PRIORITY // Support for layered scheduling priority
  8. #define _TASK_TIMEOUT // Support for overall task timeout
  9. #define _TASK_OO_CALLBACKS
  10. #include <TaskSchedulerDeclarations.h>
  11. #include "Calculator.h"
  12. //class Calculator;
  13. class SuperSensor : public Task {
  14. public:
  15. SuperSensor(Scheduler* aScheduler, int aPin, Calculator* aC, StatusRequest* aS);
  16. ~SuperSensor();
  17. void begin();
  18. void stop();
  19. long trigger();
  20. bool measurementReady();
  21. long value();
  22. bool Callback();
  23. bool OnEnable();
  24. void OnDisable();
  25. private:
  26. long iDelay;
  27. long iValue;
  28. int iPin;
  29. unsigned long iStart;
  30. Calculator* iC;
  31. StatusRequest* iS;
  32. };
  33. #endif // _SUPER_SENSOR_H