50 lines
833 B
C++
50 lines
833 B
C++
#include <Arduino.h>
|
|
#include "pcf_butt.h"
|
|
|
|
pcf_butt::pcf_butt()
|
|
{
|
|
curState = false;
|
|
}
|
|
|
|
pcf_butt::pcf_butt(bool state)
|
|
{
|
|
curState = state;
|
|
}
|
|
|
|
bool pcf_butt::chngUp(bool state)
|
|
{
|
|
curState = state;
|
|
if((lastState != curState) && curState == true){
|
|
Serial.println("Down");
|
|
lastState = curState;
|
|
return true;
|
|
}
|
|
else {
|
|
lastState = curState;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool pcf_butt::chngDown(bool state)
|
|
{
|
|
curState = state;
|
|
if((lastState != curState) && curState == false){
|
|
Serial.println("Down");
|
|
lastState = curState;
|
|
return true;
|
|
}
|
|
else {
|
|
lastState = curState;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
void pcf_butt::update(bool state)
|
|
{
|
|
curState = state;
|
|
}
|
|
|
|
pcf_butt::~pcf_butt()
|
|
{
|
|
}
|