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.
Revision 22:394337a4205a, committed 2022-10-15
- 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 |
--- 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; };
--- 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();