teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Committer:
takeru0x1103
Date:
Sat Dec 01 14:03:08 2018 +0000
Revision:
18:5aa48aec9cae
Child:
19:4b0fe9a5ec38
??????????PID????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takeru0x1103 18:5aa48aec9cae 1 #include "HbMotor.h"
takeru0x1103 18:5aa48aec9cae 2 #include "fpga.h"
takeru0x1103 18:5aa48aec9cae 3
takeru0x1103 18:5aa48aec9cae 4 //=========================================
takeru0x1103 18:5aa48aec9cae 5 //コンストラクタ
takeru0x1103 18:5aa48aec9cae 6 //=========================================
takeru0x1103 18:5aa48aec9cae 7 HbMotor::HbMotor(UCHAR iID ){
takeru0x1103 18:5aa48aec9cae 8 id =iID;
takeru0x1103 18:5aa48aec9cae 9 ofs =100;//
takeru0x1103 18:5aa48aec9cae 10 limitH =500;
takeru0x1103 18:5aa48aec9cae 11 limitL =-500;
takeru0x1103 18:5aa48aec9cae 12 }
takeru0x1103 18:5aa48aec9cae 13
takeru0x1103 18:5aa48aec9cae 14 //-----------------------------------------
takeru0x1103 18:5aa48aec9cae 15 //モーター設定
takeru0x1103 18:5aa48aec9cae 16 //-----------------------------------------
takeru0x1103 18:5aa48aec9cae 17 void HbMotor::setValue(INT16 iVal){
takeru0x1103 18:5aa48aec9cae 18 UINT16 val;
takeru0x1103 18:5aa48aec9cae 19 UINT16 slt;
takeru0x1103 18:5aa48aec9cae 20
takeru0x1103 18:5aa48aec9cae 21 //入力リミット
takeru0x1103 18:5aa48aec9cae 22 if( iVal > limitH ){
takeru0x1103 18:5aa48aec9cae 23 val = limitH;
takeru0x1103 18:5aa48aec9cae 24 }else if( iVal < limitL ){
takeru0x1103 18:5aa48aec9cae 25 val = limitL;
takeru0x1103 18:5aa48aec9cae 26 }else{
takeru0x1103 18:5aa48aec9cae 27 val = iVal;
takeru0x1103 18:5aa48aec9cae 28 }
takeru0x1103 18:5aa48aec9cae 29
takeru0x1103 18:5aa48aec9cae 30 //オフセット重畳
takeru0x1103 18:5aa48aec9cae 31 val = val + ofs;
takeru0x1103 18:5aa48aec9cae 32
takeru0x1103 18:5aa48aec9cae 33 fpgaSubProp(id,val);
takeru0x1103 18:5aa48aec9cae 34 }