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.
Diff: HbMotor.cpp
- Revision:
- 25:f3a6e7eec9c3
- Parent:
- 24:c5945aaae777
- Child:
- 27:ff63c23bc689
--- a/HbMotor.cpp Mon Dec 10 12:29:37 2018 +0000 +++ b/HbMotor.cpp Wed Dec 12 23:52:22 2018 +0000 @@ -7,8 +7,9 @@ HbMotor::HbMotor(UCHAR iID ){ id =iID; ofs =0;// - limitH =800; - limitL =-800; + limitH =2000; + limitL =-2000; + curVal = 0; } //----------------------------------------- @@ -27,16 +28,31 @@ } //オフセット重畳 - val = val + ofs; - + curVal = val = val + ofs; + //sp.printf("MOT [%d]",curVal);//Test Code //PWM幅設定 fpgaSubProp(id,val); } -void HbMotor::setOffset(INT16 iVal){ + +void HbMotor::setOfs(INT16 iVal){ ofs = iVal; } +INT16 HbMotor::getOfs(){ + return ofs; +} + void HbMotor::setLimit(INT16 low, INT16 hi){ limitL = low; limitH = hi; -} \ No newline at end of file +} + +INT16 HbMotor::getCurrentValue(){ + return curVal; +} + +void HbMotor::setValueDirect(INT16 iVal){ + //PWM幅設定 + //sp.printf("MOT [%d]",iVal);//Test Code + fpgaSubProp(id,iVal); +}