first lib
Dependents: 17robo_fuzi 17robo_tokyo_kaede
event_var.cpp@1:0643baecf9e9, 2017-10-22 (annotated)
- Committer:
- echo_piyo
- Date:
- Sun Oct 22 11:16:27 2017 +0000
- Revision:
- 1:0643baecf9e9
- Parent:
- 0:c5f25a970069
(?)?????????????;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 0:c5f25a970069 | 1 | #include "event_var.h" |
echo_piyo | 0:c5f25a970069 | 2 | void eventVar::input(int inputState) { |
echo_piyo | 0:c5f25a970069 | 3 | valState = ((valState<<1)|inputState)&3; |
echo_piyo | 0:c5f25a970069 | 4 | if(valState == 1) { |
echo_piyo | 0:c5f25a970069 | 5 | riseState = 1; |
echo_piyo | 0:c5f25a970069 | 6 | fallState = 0; |
echo_piyo | 0:c5f25a970069 | 7 | } else if(valState == 2){ |
echo_piyo | 0:c5f25a970069 | 8 | riseState = 0; |
echo_piyo | 0:c5f25a970069 | 9 | fallState = 1; |
echo_piyo | 0:c5f25a970069 | 10 | } else { |
echo_piyo | 0:c5f25a970069 | 11 | riseState = 0; |
echo_piyo | 0:c5f25a970069 | 12 | fallState = 0; |
echo_piyo | 0:c5f25a970069 | 13 | } |
echo_piyo | 0:c5f25a970069 | 14 | } |
echo_piyo | 0:c5f25a970069 | 15 | |
echo_piyo | 0:c5f25a970069 | 16 | int eventVar::getRise(){ |
echo_piyo | 0:c5f25a970069 | 17 | return riseState; |
echo_piyo | 0:c5f25a970069 | 18 | } |
echo_piyo | 0:c5f25a970069 | 19 | |
echo_piyo | 0:c5f25a970069 | 20 | int eventVar::getFall(){ |
echo_piyo | 0:c5f25a970069 | 21 | return fallState; |
echo_piyo | 0:c5f25a970069 | 22 | } |