first lib
Dependents: 17robo_fuzi 17robo_tokyo_kaede
Diff: event_var.h
- Revision:
- 0:c5f25a970069
- Child:
- 1:0643baecf9e9
diff -r 000000000000 -r c5f25a970069 event_var.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/event_var.h Sun Sep 24 05:24:48 2017 +0000 @@ -0,0 +1,36 @@ +/****************************************************** +-Class [varEvent] + +The [varEvent] is used to trigger an event when input data state changes. + +目的: + 入力された状態の[立ち上がり],[立ち下がり]を検知する + [Rise(0->1)],[Fall(1->0)] + Sbdbt用として作成,流用可 + +使い方: +Public Member Functions: + + varEvent <useName> //宣言 + .input((int)<inputData>) //(void)検出したい変数(Data)を引数に代入 + .getRise() //(int)立ち上がり検知 検出時は(int)1,それ以外は(int)0を返す + .getFall() //(int)立ち下がり検知 検出時は(int)1,それ以外は(int)0を返す + +***************************************************************/ + +#ifndef MBED_EVENT_VAR_H +#define MBED_EVENT_VAR_H +#include "mbed.h" + +class eventVar { +public: + void input(int inputState); + int getRise(); + int getFall(); + +private: + int inputState, valState; + int riseState, fallState; +}; + +#endif \ No newline at end of file