mit
Encoder.h@4:5ae9f8b3a16f, 2015-11-24 (annotated)
- Committer:
- abuchan
- Date:
- Tue Nov 24 03:56:22 2015 +0000
- Revision:
- 4:5ae9f8b3a16f
Decoupled position and current control working.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
abuchan | 4:5ae9f8b3a16f | 1 | #include "mbed.h" |
abuchan | 4:5ae9f8b3a16f | 2 | #include "QEI.h" |
abuchan | 4:5ae9f8b3a16f | 3 | |
abuchan | 4:5ae9f8b3a16f | 4 | #ifndef ENCODER_H |
abuchan | 4:5ae9f8b3a16f | 5 | #define ENCODER_H |
abuchan | 4:5ae9f8b3a16f | 6 | |
abuchan | 4:5ae9f8b3a16f | 7 | |
abuchan | 4:5ae9f8b3a16f | 8 | #define PI 3.14159265358979323846 |
abuchan | 4:5ae9f8b3a16f | 9 | #define ENC_STEPS_PER_REV 1200 |
abuchan | 4:5ae9f8b3a16f | 10 | |
abuchan | 4:5ae9f8b3a16f | 11 | class Encoder { |
abuchan | 4:5ae9f8b3a16f | 12 | public: |
abuchan | 4:5ae9f8b3a16f | 13 | Encoder(PinName enc_a_pin, PinName enc_b_pin); |
abuchan | 4:5ae9f8b3a16f | 14 | |
abuchan | 4:5ae9f8b3a16f | 15 | float get_position(void); |
abuchan | 4:5ae9f8b3a16f | 16 | |
abuchan | 4:5ae9f8b3a16f | 17 | private: |
abuchan | 4:5ae9f8b3a16f | 18 | QEI qei_; |
abuchan | 4:5ae9f8b3a16f | 19 | |
abuchan | 4:5ae9f8b3a16f | 20 | }; |
abuchan | 4:5ae9f8b3a16f | 21 | |
abuchan | 4:5ae9f8b3a16f | 22 | #endif |