ai
Dependents: ball_snatch NHK2020-arm-sub NHK2020-arm-sub NHK2020-arm-sub2 ... more
Revision 13:9a21d4def4c6, committed 2019-11-09
- Comitter:
- aoikoizumi
- Date:
- Sat Nov 09 06:53:58 2019 +0000
- Parent:
- 12:f261038cb88f
- Commit message:
- 20191109
Changed in this revision
EC.cpp | Show annotated file Show diff for this revision Revisions of this file |
EC.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/EC.cpp Fri Aug 09 06:27:49 2019 +0000 +++ b/EC.cpp Sat Nov 09 06:53:58 2019 +0000 @@ -11,6 +11,7 @@ int Ec::getCount()const { return count_; + //return pre_count_; } double Ec::getRad()const @@ -22,6 +23,8 @@ { double t=timer_.read(); omega_=(count_-pre_count_)*2.0f*M_PI/(multiplication_*resolution_*(t-ptw_)); +// omega_=(getCount()-pre_count_)*2.0f*M_PI/(multiplication_*resolution_*(t-ptw_)); + //pre_count_=getCount(); pre_count_=count_; ptw_=t; }
--- a/EC.h Fri Aug 09 06:27:49 2019 +0000 +++ b/EC.h Sat Nov 09 06:53:58 2019 +0000 @@ -97,6 +97,9 @@ void setResolution(int res); ///エンコーダのcountやωをリセットするための関数 void reset(); + + double time(); + Timer timer_; }; ///@brief increment型エンコーダ用class(1逓倍)