An interface for a simple, 1-track, incremental encoder.
Dependents: AVC_20110423 incrementalencoder-pid-robot DataBus2018
Revision 1:5011d894d5a7, committed 2018-12-23
- Comitter:
- shimniok
- Date:
- Sun Dec 23 18:29:10 2018 +0000
- Parent:
- 0:dea4a931b267
- Commit message:
- Updated to use current callback interface
Changed in this revision
IncrementalEncoder.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r dea4a931b267 -r 5011d894d5a7 IncrementalEncoder.cpp --- a/IncrementalEncoder.cpp Wed Apr 27 17:58:52 2011 +0000 +++ b/IncrementalEncoder.cpp Sun Dec 23 18:29:10 2018 +0000 @@ -2,8 +2,8 @@ IncrementalEncoder::IncrementalEncoder(PinName pin): _lastTicks(0), _ticks(0), _interrupt(pin) { _interrupt.mode(PullNone); // default is pulldown but my encoder board uses a pull-up and that just don't work - _interrupt.rise(this, &IncrementalEncoder::_increment); - _interrupt.fall(this, &IncrementalEncoder::_increment); + _interrupt.rise(callback(this, &IncrementalEncoder::_increment)); + _interrupt.fall(callback(this, &IncrementalEncoder::_increment)); } unsigned int IncrementalEncoder::read() {