This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28335正交编码器EQep1Regs.QPOSCNT为什么是负数



正转是正数,反转时负数,为什么呢?而且在运行时转电机得到的是0,手转电机得到的是前面说的情况

void read_eqep()
{
       i++;
      if(i>10000)   //开关来启动或停止数组存储
     {
             i=0;
             if(GpioDataRegs.GPADAT.bit.GPIO12==0)
             {
                            eqepzhi[count]=EQep1Regs.QPOSCNT;
                           count++;
                          if(count>999)
                         count=0; 
               }
        }
}

这段程序放在while(1)中