Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
rotary_encoder.cpp@7:3b51e2c660b6, 2016-05-21 (annotated)
- Committer:
- inst
- Date:
- Sat May 21 02:50:07 2016 +0000
- Revision:
- 7:3b51e2c660b6
- Parent:
- 2:4580c3869b7b
- Child:
- 10:684e1604e5ea
???????;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| inst | 0:caf1d0bc4b90 | 1 | #include "mbed.h" |
| inst | 0:caf1d0bc4b90 | 2 | #include "rotary_encoder.hpp" |
| inst | 0:caf1d0bc4b90 | 3 | |
| inst | 0:caf1d0bc4b90 | 4 | const size_t rotary_encoder::max_counts_ = 0xFFFF; |
| inst | 0:caf1d0bc4b90 | 5 | |
| inst | 0:caf1d0bc4b90 | 6 | rotary_encoder::rotary_encoder(size_t resolution) : |
| inst | 0:caf1d0bc4b90 | 7 | resolution_(resolution) {} |
| inst | 0:caf1d0bc4b90 | 8 | rotary_encoder::~rotary_encoder() {} |
| inst | 0:caf1d0bc4b90 | 9 | |
| inst | 0:caf1d0bc4b90 | 10 | float rotary_encoder::get_revol_num() const { |
| inst | 0:caf1d0bc4b90 | 11 | return static_cast<float>(get_counts()) / resolution_; |
| inst | 0:caf1d0bc4b90 | 12 | } |