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
- Committer:
- inst
- Date:
- 2016-02-06
- Revision:
- 0:caf1d0bc4b90
- Child:
- 2:4580c3869b7b
File content as of revision 0:caf1d0bc4b90:
#include "mbed.h"
#include "rotary_encoder.hpp"
const size_t rotary_encoder::max_counts_ = 0xFFFF;
rotary_encoder::rotary_encoder(size_t resolution) :
resolution_(resolution) {}
rotary_encoder::~rotary_encoder() {}
float rotary_encoder::get_revol_num() const {
return static_cast<float>(get_counts()) / resolution_;
}