test
Diff: EC.cpp
- Revision:
- 10:ad0f13db7b92
- Parent:
- 8:17aff8f21d19
- Child:
- 11:acbbd742df47
diff -r 78eeb2d3dc80 -r ad0f13db7b92 EC.cpp --- a/EC.cpp Wed Jul 24 17:13:34 2019 +0000 +++ b/EC.cpp Wed Jul 24 17:21:00 2019 +0000 @@ -13,6 +13,11 @@ return count_; } +double Ec::getAngle()const +{ + return count_*2.0f*M_PI/(multiplication_*resolution_); +} + void Ec::calOmega() { double t=timer_.read(); @@ -25,7 +30,8 @@ { return omega_; } -void Ec::setResolution(int res){ +void Ec::setResolution(int res) +{ resolution_=res; }