first lib

Dependents:   17robo_fuzi 17robo_tokyo_kaede

Committer:
echo_piyo
Date:
Sun Oct 22 11:16:27 2017 +0000
Revision:
1:0643baecf9e9
Parent:
0:c5f25a970069
(?)?????????????;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
echo_piyo 0:c5f25a970069 1 /******************************************************
echo_piyo 0:c5f25a970069 2 -Class [varEvent]
echo_piyo 0:c5f25a970069 3
echo_piyo 0:c5f25a970069 4 The [varEvent] is used to trigger an event when input data state changes.
echo_piyo 0:c5f25a970069 5
echo_piyo 0:c5f25a970069 6 目的:
echo_piyo 0:c5f25a970069 7 入力された状態の[立ち上がり],[立ち下がり]を検知する
echo_piyo 0:c5f25a970069 8 [Rise(0->1)],[Fall(1->0)]
echo_piyo 0:c5f25a970069 9 Sbdbt用として作成,流用可
echo_piyo 0:c5f25a970069 10
echo_piyo 0:c5f25a970069 11 使い方:
echo_piyo 0:c5f25a970069 12 Public Member Functions:
echo_piyo 0:c5f25a970069 13
echo_piyo 1:0643baecf9e9 14 eventVar <useName> //宣言
echo_piyo 0:c5f25a970069 15 .input((int)<inputData>) //(void)検出したい変数(Data)を引数に代入
echo_piyo 0:c5f25a970069 16 .getRise() //(int)立ち上がり検知 検出時は(int)1,それ以外は(int)0を返す
echo_piyo 0:c5f25a970069 17 .getFall() //(int)立ち下がり検知 検出時は(int)1,それ以外は(int)0を返す
echo_piyo 0:c5f25a970069 18
echo_piyo 0:c5f25a970069 19 ***************************************************************/
echo_piyo 0:c5f25a970069 20
echo_piyo 0:c5f25a970069 21 #ifndef MBED_EVENT_VAR_H
echo_piyo 0:c5f25a970069 22 #define MBED_EVENT_VAR_H
echo_piyo 0:c5f25a970069 23 #include "mbed.h"
echo_piyo 0:c5f25a970069 24
echo_piyo 0:c5f25a970069 25 class eventVar {
echo_piyo 0:c5f25a970069 26 public:
echo_piyo 0:c5f25a970069 27 void input(int inputState);
echo_piyo 0:c5f25a970069 28 int getRise();
echo_piyo 0:c5f25a970069 29 int getFall();
echo_piyo 0:c5f25a970069 30
echo_piyo 0:c5f25a970069 31 private:
echo_piyo 0:c5f25a970069 32 int inputState, valState;
echo_piyo 0:c5f25a970069 33 int riseState, fallState;
echo_piyo 0:c5f25a970069 34 };
echo_piyo 0:c5f25a970069 35
echo_piyo 0:c5f25a970069 36 #endif