Dependents: serial_connected_mcu_nucleo rotary_encoder_mbed serial_connected_mcu_nucleo omuni_speed_pid ... more
Fork of rotary_encoder by
このライブラリは以下のプログラムに基いています https://developer.mbed.org/users/gregeric/code/Nucleo_Hello_Encoder/
rotary_encoder.hpp@2:4580c3869b7b, 2016-02-26 (annotated)
- Committer:
- inst
- Date:
- Fri Feb 26 16:08:52 2016 +0000
- Revision:
- 2:4580c3869b7b
- Parent:
- 0:caf1d0bc4b90
- Child:
- 4:d07f58c46a79
add servo and PID
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
inst | 2:4580c3869b7b | 1 | #ifndef INCLUDED_MBED_STL_ROTARY_ENCODER_H |
inst | 2:4580c3869b7b | 2 | #define INCLUDED_MBED_STL_ROTARY_ENCODER_H |
inst | 0:caf1d0bc4b90 | 3 | |
inst | 0:caf1d0bc4b90 | 4 | #include "mbed.h" |
inst | 0:caf1d0bc4b90 | 5 | |
inst | 2:4580c3869b7b | 6 | namespace mbed_stl { |
inst | 2:4580c3869b7b | 7 | |
inst | 0:caf1d0bc4b90 | 8 | class rotary_encoder { |
inst | 0:caf1d0bc4b90 | 9 | public: |
inst | 0:caf1d0bc4b90 | 10 | rotary_encoder(size_t resolution); |
inst | 0:caf1d0bc4b90 | 11 | virtual ~rotary_encoder() = 0; |
inst | 0:caf1d0bc4b90 | 12 | |
inst | 0:caf1d0bc4b90 | 13 | virtual int32_t get_counts() const = 0; |
inst | 0:caf1d0bc4b90 | 14 | float get_revol_num() const; |
inst | 0:caf1d0bc4b90 | 15 | |
inst | 0:caf1d0bc4b90 | 16 | virtual void reset() = 0; |
inst | 0:caf1d0bc4b90 | 17 | virtual void start() = 0; |
inst | 0:caf1d0bc4b90 | 18 | virtual void stop() = 0; |
inst | 0:caf1d0bc4b90 | 19 | |
inst | 0:caf1d0bc4b90 | 20 | protected: |
inst | 0:caf1d0bc4b90 | 21 | static const size_t max_counts_; |
inst | 0:caf1d0bc4b90 | 22 | const size_t resolution_; |
inst | 0:caf1d0bc4b90 | 23 | }; |
inst | 0:caf1d0bc4b90 | 24 | |
inst | 2:4580c3869b7b | 25 | } /* namespace mbed_stl */ |
inst | 2:4580c3869b7b | 26 | |
inst | 0:caf1d0bc4b90 | 27 | #endif |