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/

Files at this revision

API Documentation at this revision

Comitter:
inst
Date:
Sat Jun 25 05:40:31 2016 +0000
Parent:
9:d1e6284a13ab
Commit message:
add read() to rotary_encoder;

Changed in this revision

rotary_encoder.cpp Show annotated file Show diff for this revision Revisions of this file
rotary_encoder.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r d1e6284a13ab -r 684e1604e5ea rotary_encoder.cpp
--- a/rotary_encoder.cpp	Sat May 21 03:19:33 2016 +0000
+++ b/rotary_encoder.cpp	Sat Jun 25 05:40:31 2016 +0000
@@ -10,3 +10,7 @@
 float rotary_encoder::get_revol_num() const {
     return static_cast<float>(get_counts()) / resolution_;
 }
+
+float rotary_encoder::read() const {
+    return get_revol_num();
+}
diff -r d1e6284a13ab -r 684e1604e5ea rotary_encoder.hpp
--- a/rotary_encoder.hpp	Sat May 21 03:19:33 2016 +0000
+++ b/rotary_encoder.hpp	Sat Jun 25 05:40:31 2016 +0000
@@ -11,6 +11,7 @@
     
     virtual int32_t get_counts() const = 0;
     float get_revol_num() const;
+    float read() const;
     
     virtual void reset() = 0;
     virtual void start() = 0;