RT-Thread-packages / rt-robot

a platform in creating new exciting robots
Apache License 2.0
112 stars 62 forks source link

请问如何对单个电机进行开环测试和编码器读取呢? #32

Closed incarry closed 4 years ago

incarry commented 4 years ago
while (1)
{
    rt_thread_mdelay(50);       
    motor_run((motor_t)chas->c_wheels[1]->w_motor,1000);
    rt_kprintf("encoder2 = %d \n",encoder_read((encoder_t)chas->c_wheels[1]->w_encoder));
}

尝试这样执行,电机转不起来,不知道这样写对不对