first
Dependents: 17robo_fuzi 17robo_tokyo_kaede
cyclic_io.h@0:3555e86bf40d, 2017-09-20 (annotated)
- Committer:
- echo_piyo
- Date:
- Wed Sep 20 07:09:50 2017 +0000
- Revision:
- 0:3555e86bf40d
- Child:
- 1:e0bcbeb71a97
1??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 0:3555e86bf40d | 1 | /* |
echo_piyo | 0:3555e86bf40d | 2 | * [CyclicIo] |
echo_piyo | 0:3555e86bf40d | 3 | * **任意の0/1状態(sbdbtのボタン)を受け渡すことで、指定のIOをサイクリックする |
echo_piyo | 0:3555e86bf40d | 4 | * |
echo_piyo | 0:3555e86bf40d | 5 | * [Public Member Functions] |
echo_piyo | 0:3555e86bf40d | 6 | * CyclicIo(PinName pin) |
echo_piyo | 0:3555e86bf40d | 7 | * **<Create> 宣言 |
echo_piyo | 0:3555e86bf40d | 8 | * |
echo_piyo | 0:3555e86bf40d | 9 | * cyclic(<int> state) |
echo_piyo | 0:3555e86bf40d | 10 | * **<int> (ボタン等の)0/1で状態を入力 |
echo_piyo | 0:3555e86bf40d | 11 | * |
echo_piyo | 0:3555e86bf40d | 12 | * getState() |
echo_piyo | 0:3555e86bf40d | 13 | * **<int> サイクリックの状態を出力 |
echo_piyo | 0:3555e86bf40d | 14 | */ |
echo_piyo | 0:3555e86bf40d | 15 | |
echo_piyo | 0:3555e86bf40d | 16 | #ifndef MBED_CYCLIC_IO_H |
echo_piyo | 0:3555e86bf40d | 17 | #define MBED_CYCLIC_IO_H |
echo_piyo | 0:3555e86bf40d | 18 | |
echo_piyo | 0:3555e86bf40d | 19 | #include "mbed.h" |
echo_piyo | 0:3555e86bf40d | 20 | |
echo_piyo | 0:3555e86bf40d | 21 | class CyclicIo |
echo_piyo | 0:3555e86bf40d | 22 | { |
echo_piyo | 0:3555e86bf40d | 23 | public: |
echo_piyo | 0:3555e86bf40d | 24 | CyclicIo(PinName pin); |
echo_piyo | 0:3555e86bf40d | 25 | void cyclic(int state); |
echo_piyo | 0:3555e86bf40d | 26 | int getState(); |
echo_piyo | 0:3555e86bf40d | 27 | |
echo_piyo | 0:3555e86bf40d | 28 | private: |
echo_piyo | 0:3555e86bf40d | 29 | DigitalOut gpio; |
echo_piyo | 0:3555e86bf40d | 30 | bool flag; |
echo_piyo | 0:3555e86bf40d | 31 | }; |
echo_piyo | 0:3555e86bf40d | 32 | |
echo_piyo | 0:3555e86bf40d | 33 | #endif |