first lib

Dependents:   17robo_fuzi 17robo_tokyo_kaede

event_var.cpp

Committer:
echo_piyo
Date:
2017-09-24
Revision:
0:c5f25a970069

File content as of revision 0:c5f25a970069:

#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;   
    }