change2shinsu
Dependencies: mbed mbedTimer SDFileSystem MU2 GPS
inletclose/inletclose.h@21:fa4360ec5014, 2019-09-09 (annotated)
- Committer:
- takepiyo
- Date:
- Mon Sep 09 06:35:47 2019 +0000
- Revision:
- 21:fa4360ec5014
- Parent:
- 16:917a2c03bd7c
2shinsuuled
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takepiyo | 3:4f1bac105598 | 1 | #include "mbed.h" |
takepiyo | 3:4f1bac105598 | 2 | |
takepiyo | 3:4f1bac105598 | 3 | #ifndef InletClose_H |
takepiyo | 3:4f1bac105598 | 4 | #define InletClose_H |
takepiyo | 3:4f1bac105598 | 5 | |
takepiyo | 3:4f1bac105598 | 6 | class Inlet |
takepiyo | 3:4f1bac105598 | 7 | { |
takepiyo | 3:4f1bac105598 | 8 | private: |
Nerosho | 16:917a2c03bd7c | 9 | DigitalOut _Out;//モータ用 1で回転,0で停止 |
takepiyo | 3:4f1bac105598 | 10 | |
Nerosho | 16:917a2c03bd7c | 11 | AnalogIn _In1; |
Nerosho | 16:917a2c03bd7c | 12 | AnalogIn _In2;//感圧センサーとつなぐピン |
Nerosho | 16:917a2c03bd7c | 13 | |
takepiyo | 3:4f1bac105598 | 14 | |
Nerosho | 16:917a2c03bd7c | 15 | |
Nerosho | 16:917a2c03bd7c | 16 | public: |
takepiyo | 3:4f1bac105598 | 17 | |
Nerosho | 16:917a2c03bd7c | 18 | float value1;//感圧センサーの値をいれる |
Nerosho | 16:917a2c03bd7c | 19 | float value2; |
takepiyo | 3:4f1bac105598 | 20 | |
takepiyo | 3:4f1bac105598 | 21 | Inlet(PinName Out,PinName In1,PinName In2) |
Nerosho | 16:917a2c03bd7c | 22 | :_Out(Out),_In1(In1),_In2(In2) {} |
Nerosho | 16:917a2c03bd7c | 23 | |
Nerosho | 16:917a2c03bd7c | 24 | |
takepiyo | 21:fa4360ec5014 | 25 | void Close() |
takepiyo | 3:4f1bac105598 | 26 | { |
takepiyo | 3:4f1bac105598 | 27 | _Out=1; |
takepiyo | 3:4f1bac105598 | 28 | } |
Nerosho | 16:917a2c03bd7c | 29 | |
takepiyo | 8:6b835a82b1eb | 30 | void Stop() |
takepiyo | 8:6b835a82b1eb | 31 | { |
Nerosho | 16:917a2c03bd7c | 32 | _Out=0; |
takepiyo | 8:6b835a82b1eb | 33 | } |
Nerosho | 16:917a2c03bd7c | 34 | |
Nerosho | 16:917a2c03bd7c | 35 | float getvalue1() |
takepiyo | 3:4f1bac105598 | 36 | { |
takepiyo | 3:4f1bac105598 | 37 | value1=_In1.read(); |
Nerosho | 16:917a2c03bd7c | 38 | return value1; |
Nerosho | 16:917a2c03bd7c | 39 | } |
takepiyo | 3:4f1bac105598 | 40 | |
Nerosho | 16:917a2c03bd7c | 41 | float getvalue2() |
takepiyo | 3:4f1bac105598 | 42 | { |
takepiyo | 3:4f1bac105598 | 43 | value2=_In2.read(); |
Nerosho | 16:917a2c03bd7c | 44 | return value2; |
Nerosho | 16:917a2c03bd7c | 45 | } |
takepiyo | 3:4f1bac105598 | 46 | |
takepiyo | 3:4f1bac105598 | 47 | |
takepiyo | 3:4f1bac105598 | 48 | }; |
takepiyo | 3:4f1bac105598 | 49 | |
takepiyo | 3:4f1bac105598 | 50 | #endif |