![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
Revision 22:394337a4205a, committed 22 months ago
- Comitter:
- yootee
- Date:
- Sat Oct 15 07:52:25 2022 +0000
- Parent:
- 21:72dcbbfeb5d8
- Commit message:
- upgrade
Changed in this revision
sensor/rotary_inc_sp.cpp | Show annotated file Show diff for this revision Revisions of this file |
sensor/rotary_inc_sp.hpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 72dcbbfeb5d8 -r 394337a4205a sensor/rotary_inc_sp.cpp --- a/sensor/rotary_inc_sp.cpp Fri Sep 30 00:07:30 2022 +0000 +++ b/sensor/rotary_inc_sp.cpp Sat Oct 15 07:52:25 2022 +0000 @@ -11,6 +11,12 @@ init(pin_a,pin_b); } +RotaryInc::RotaryInc(Port port,double circumference,int resolution,int mode) + :mode_(mode),resolution_(resolution),circumference_(circumference){ + measur_ = true; + init(port.pin[0],port.pin[1]); +} + RotaryInc::RotaryInc(){ measur_ = true; };
diff -r 72dcbbfeb5d8 -r 394337a4205a sensor/rotary_inc_sp.hpp --- a/sensor/rotary_inc_sp.hpp Fri Sep 30 00:07:30 2022 +0000 +++ b/sensor/rotary_inc_sp.hpp Sat Oct 15 07:52:25 2022 +0000 @@ -1,6 +1,7 @@ #ifndef ROTARY_INC_H #define ROTARY_INC_H #include "mbed.h" +#include "portSet.hpp" #ifndef M_PI #define M_PI 3.14159265358979 #endif @@ -16,6 +17,7 @@ public: RotaryInc(PinName user_a, PinName user_b,double circumference,int resolution,int mode = 0);//速度計測有効 RotaryInc(PinName user_a, PinName user_b,int mode = 0);//速度計測無効 + RotaryInc(Port port,double circumference,int resolution,int mode = 0); RotaryInc(); ~RotaryInc(); long long get();