first lib
Dependents: 17robo_fuzi 17robo_tokyo_kaede
Diff: event_var.cpp
- Revision:
- 0:c5f25a970069
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/event_var.cpp Sun Sep 24 05:24:48 2017 +0000 @@ -0,0 +1,22 @@ +#include "event_var.h" + void eventVar::input(int inputState) { + valState = ((valState<<1)|inputState)&3; + if(valState == 1) { + riseState = 1; + fallState = 0; + } else if(valState == 2){ + riseState = 0; + fallState = 1; + } else { + riseState = 0; + fallState = 0; + } + } + + int eventVar::getRise(){ + return riseState; + } + + int eventVar::getFall(){ + return fallState; + } \ No newline at end of file