12 Replies Latest reply on Jul 2, 2014 7:21 PM by ki.leung

    Quadrature Decoder SetCounter() API bug?

    user_342122993

      Hi,

         

      Quadrature Decoder function SetCounter() does not accept negative values (positive values are fine).

         

      Example:

         

                  QuadDec_SetCounter(-1); //can't set counter to a negative  value
                  sprintf(strMsg1,"counter_val=%d \r\n", QuadDec_GetCounter() );
                  SW_Tx_UART_PutString(strMsg1);
                 

         

      reading counter value in the above example returns -32767.

         

      What I want is to limit counter values to some bounds, e.g. -100...+100. 

         

      Regards,

         

      odissey1

         

      QuadDec_v2_30 (16bit)