小日向さんのMDライブラリ
Dependents: 00_yotsuba 10_motor-test 00_yotsuba 200_yotsuba_21 ... more
Diff: kohiMD.cpp
- Revision:
- 8:ba7b31b888f2
- Parent:
- 7:d7e8402e6869
- Child:
- 9:f8af7b48531c
diff -r d7e8402e6869 -r ba7b31b888f2 kohiMD.cpp --- a/kohiMD.cpp Thu Mar 04 14:21:34 2021 +0000 +++ b/kohiMD.cpp Fri Mar 05 00:00:36 2021 +0000 @@ -11,12 +11,12 @@ void KohiMD::setSpeed(double speed_) { - _pwmMD = mdlpf.path_value(speed); + _pwmMD = mdlpf.path_value(speed_); _pwmMD = 0.5 + _pwmMD /2.0; if(_pwmMD > 0.9) _pwmMD = 0.9; if(_pwmMD < 0.1) _pwmMD = 0.1; - pwmMD.write(speed); - printf("%d\r\n",(int)(speed*10)); + pwmMD.write(_pwmMD); + printf("%d\r\n",(int)(_pwmMD*10)); // MDloop(); } //