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.
HbMotor.cpp
- Committer:
- MasashiNomura
- Date:
- 2018-12-10
- Revision:
- 24:c5945aaae777
- Parent:
- 19:4b0fe9a5ec38
- Child:
- 25:f3a6e7eec9c3
File content as of revision 24:c5945aaae777:
#include "HbMotor.h" #include "fpga.h" //========================================= //コンストラクタ //========================================= HbMotor::HbMotor(UCHAR iID ){ id =iID; ofs =0;// limitH =800; limitL =-800; } //----------------------------------------- //モーター設定 //----------------------------------------- void HbMotor::setValue(INT16 iVal){ UINT16 val; //入力リミット if( iVal > limitH ){ val = limitH; }else if( iVal < limitL ){ val = limitL; }else{ val = iVal; } //オフセット重畳 val = val + ofs; //PWM幅設定 fpgaSubProp(id,val); } void HbMotor::setOffset(INT16 iVal){ ofs = iVal; } void HbMotor::setLimit(INT16 low, INT16 hi){ limitL = low; limitH = hi; }