Skip to main content
MMoha.10
Associate III
October 21, 2024
Question

How to get Speed in RPM from MC_GetMecSpeedReferenceMotor1()

  • October 21, 2024
  • 1 reply
  • 711 views

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

    Gael A
    ST Employee
    October 22, 2024

    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.