Removed _lastTime private variable, was not used.

This commit is contained in:
Jack Christensen
2012-04-05 21:43:12 -04:00
parent b30f7d8ac7
commit 6b361db68d
2 changed files with 0 additions and 4 deletions

View File

@@ -43,7 +43,6 @@ Button::Button(uint8_t pin, uint8_t puEnable, uint8_t invert, uint32_t dbTime)
_time = millis();
_lastState = _state;
_changed = 0;
_lastTime = _time;
_lastChange = _time;
}
@@ -60,13 +59,11 @@ uint8_t Button::read(void)
pinVal = digitalRead(_pin);
if (_invert != 0) pinVal = !pinVal;
if (ms - _lastChange < _dbTime) {
_lastTime = _time;
_time = ms;
_changed = 0;
return _state;
}
else {
_lastTime = _time;
_lastState = _state;
_state = pinVal;
_time = ms;

View File

@@ -36,7 +36,6 @@ class Button
uint8_t _lastState; //previous button state
uint8_t _changed; //state changed since last read
uint32_t _time; //time of current state (all times are in ms)
uint32_t _lastTime; //time of previous state
uint32_t _lastChange; //time of last state change
uint32_t _dbTime; //debounce time
};