Dependents:   serial_connected_mcu_nucleo rotary_encoder_mbed serial_connected_mcu_nucleo omuni_speed_pid ... more

Fork of rotary_encoder by tarou yamada

このライブラリは以下のプログラムに基いています https://developer.mbed.org/users/gregeric/code/Nucleo_Hello_Encoder/

Committer:
inst
Date:
Fri Feb 26 16:08:52 2016 +0000
Revision:
2:4580c3869b7b
Parent:
0:caf1d0bc4b90
Child:
7:3b51e2c660b6
add servo and PID

Who changed what in which revision?

UserRevisionLine numberNew contents of line
inst 0:caf1d0bc4b90 1 #include "mbed.h"
inst 0:caf1d0bc4b90 2 #include "rotary_encoder.hpp"
inst 0:caf1d0bc4b90 3
inst 2:4580c3869b7b 4 namespace mbed_stl {
inst 2:4580c3869b7b 5
inst 0:caf1d0bc4b90 6 const size_t rotary_encoder::max_counts_ = 0xFFFF;
inst 0:caf1d0bc4b90 7
inst 0:caf1d0bc4b90 8 rotary_encoder::rotary_encoder(size_t resolution) :
inst 0:caf1d0bc4b90 9 resolution_(resolution) {}
inst 0:caf1d0bc4b90 10 rotary_encoder::~rotary_encoder() {}
inst 0:caf1d0bc4b90 11
inst 0:caf1d0bc4b90 12 float rotary_encoder::get_revol_num() const {
inst 0:caf1d0bc4b90 13 return static_cast<float>(get_counts()) / resolution_;
inst 0:caf1d0bc4b90 14 }
inst 2:4580c3869b7b 15
inst 2:4580c3869b7b 16 } /* namespace mbed_stl */