Mutila: Mouse's Utilities for Arduino
Oft-used utilities: debouncing buttons, averaging samples, and so on.
BrownoutMode.h
1 #pragma once
2 
3 #include "Mode.h"
4 #include "EMAVDivSampler.h"
5 
13 class BrownoutMode : public Mode {
14 public:
20  BrownoutMode(EMAVDivSampler& vSampler, const float vThreshLow, const float vThreshHigh);
21 
25  virtual void update();
26 
31  virtual void enterBrownout() {;}
32 
37  virtual void exitBrownout() {;}
38 
42  bool brownedOut() { return _brownedOut; }
43 
44 protected:
45  EMAVDivSampler& _vSampler;
46  float _vThreshLow;
47  float _vThreshHigh;
48  bool _brownedOut;
49 };
50 
virtual void exitBrownout()
Definition: BrownoutMode.h:37
virtual void update()
Definition: Mode.h:39
BrownoutMode(EMAVDivSampler &vSampler, const float vThreshLow, const float vThreshHigh)
Definition: BrownoutMode.cpp:3
virtual void enterBrownout()
Definition: BrownoutMode.h:31
bool brownedOut()
Definition: BrownoutMode.h:42
Mode class with brownout detection.
Definition: BrownoutMode.h:13
Exponential Moving Average Voltage Divider based voltage sampler.