firstaa
Dependents: 17robo_fuzi 17robo_tokyo_kaede
cylinder.h@0:46dd0245886c, 2017-09-20 (annotated)
- Committer:
- echo_piyo
- Date:
- Wed Sep 20 07:09:56 2017 +0000
- Revision:
- 0:46dd0245886c
- Child:
- 1:d4fa6f96bab5
1??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 0:46dd0245886c | 1 | /* |
echo_piyo | 0:46dd0245886c | 2 | * [Cylinder] |
echo_piyo | 0:46dd0245886c | 3 | * **シリンダ用クラス IOを2つ指定しサイクリックで出力を変更する |
echo_piyo | 0:46dd0245886c | 4 | * ** |
echo_piyo | 0:46dd0245886c | 5 | * |
echo_piyo | 0:46dd0245886c | 6 | * [Public Member Functions] |
echo_piyo | 0:46dd0245886c | 7 | * Cylinder(PinName pin_in,PinName pin_out); |
echo_piyo | 0:46dd0245886c | 8 | * **<Create> 宣言 |
echo_piyo | 0:46dd0245886c | 9 | * void cyclic(int state) |
echo_piyo | 0:46dd0245886c | 10 | * **シリンダの出力切り替え |
echo_piyo | 0:46dd0245886c | 11 | * **stateに1が入力されるたび、出力が切り替わる |
echo_piyo | 0:46dd0245886c | 12 | * int getInState() |
echo_piyo | 0:46dd0245886c | 13 | * **シリンダ[Pin_in]の状態取得 |
echo_piyo | 0:46dd0245886c | 14 | * int getOutState() |
echo_piyo | 0:46dd0245886c | 15 | * **シリンダ[Pin_out]の状態取得 |
echo_piyo | 0:46dd0245886c | 16 | */ |
echo_piyo | 0:46dd0245886c | 17 | |
echo_piyo | 0:46dd0245886c | 18 | #ifndef MBED_CYLINDER_H |
echo_piyo | 0:46dd0245886c | 19 | #define MBED_CYLINDER_H |
echo_piyo | 0:46dd0245886c | 20 | |
echo_piyo | 0:46dd0245886c | 21 | #include "mbed.h" |
echo_piyo | 0:46dd0245886c | 22 | |
echo_piyo | 0:46dd0245886c | 23 | class Cylinder |
echo_piyo | 0:46dd0245886c | 24 | { |
echo_piyo | 0:46dd0245886c | 25 | public: |
echo_piyo | 0:46dd0245886c | 26 | Cylinder(PinName pin_in,PinName pin_out); |
echo_piyo | 0:46dd0245886c | 27 | void cyclic(int state); |
echo_piyo | 0:46dd0245886c | 28 | int getInState(); |
echo_piyo | 0:46dd0245886c | 29 | int getOutState(); |
echo_piyo | 0:46dd0245886c | 30 | |
echo_piyo | 0:46dd0245886c | 31 | private: |
echo_piyo | 0:46dd0245886c | 32 | DigitalOut cylinder_in; |
echo_piyo | 0:46dd0245886c | 33 | DigitalOut cylinder_out; |
echo_piyo | 0:46dd0245886c | 34 | bool flag; |
echo_piyo | 0:46dd0245886c | 35 | }; |
echo_piyo | 0:46dd0245886c | 36 | |
echo_piyo | 0:46dd0245886c | 37 | #endif |