cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Speed in RPM from MC_GetMecSpeedReferenceMotor1()

MMoha.10
Associate III

How do I convert the value I get from MC_GetMecSpeedReferenceMotor1() into RPM, similar to how the Motor Pilot reports speed in RPM.

int16_t motorSpeed = MC_GetMecSpeedReferenceMotor1();

1 REPLY 1
Gael A
ST Employee

Hello MMoha.10,

To get your speed in rpm, you can use the MC_GetMecSpeedReferenceMotor1_F() API instead of MC_GetMecSpeedReferenceMotor1().

Generally speaking, you can find the way speed is defined in mc_stm_types.h or in the "Measurement Units used by the firmware" chapter of the MCSDK User Manual : Via WorkBench, you can find it by clicking on About -> Documentations -> Documentation -> in the newly open browser window, click on User Manual.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.