Library to read out speed and position from a quadrature encoder. This library uses X2 decoding.
Dependents: BMT-K9_encoder BMT-K9-Regelaar K9motoraansturing_copy EMGverwerking ... more
Diff: encoder.h
- Revision:
- 6:18b000b443af
- Parent:
- 5:04c4a90c7a0a
--- a/encoder.h Mon Sep 29 20:43:45 2014 +0000 +++ b/encoder.h Mon Sep 29 20:47:37 2014 +0000 @@ -2,6 +2,7 @@ #define _ENCODER_H_ #include "mbed.h" + /** Encoder class. * Used to read out incremental position encoder. Decodes position in X2 configuration. * @@ -27,6 +28,7 @@ /** Create Encoder instance @param int_a Pin to be used as InterruptIn! Be careful, as not all pins on all platforms may be used as InterruptIn. @param int_b second encoder pin, used as DigitalIn. Can be any DigitalIn pin, not necessarily on InterruptIn location + @param speed boolean value to determine whether speed calculation is done in interrupt routine. Default false (no speed calculation) */ Encoder(PinName int_a, PinName int_b, bool speed=false);