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:
- 18:5aa48aec9cae
- Child:
- 19:4b0fe9a5ec38
diff -r f9610f3cfa1b -r 5aa48aec9cae HbMotor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HbMotor.cpp Sat Dec 01 14:03:08 2018 +0000 @@ -0,0 +1,34 @@ +#include "HbMotor.h" +#include "fpga.h" + +//========================================= +//コンストラクタ +//========================================= +HbMotor::HbMotor(UCHAR iID ){ + id =iID; + ofs =100;// + limitH =500; + limitL =-500; +} + +//----------------------------------------- +//モーター設定 +//----------------------------------------- +void HbMotor::setValue(INT16 iVal){ + UINT16 val; + UINT16 slt; + + //入力リミット + if( iVal > limitH ){ + val = limitH; + }else if( iVal < limitL ){ + val = limitL; + }else{ + val = iVal; + } + + //オフセット重畳 + val = val + ofs; + + fpgaSubProp(id,val); +}