diff --git a/rt-thread-version/rt-thread-standard/programming-manual/device/pulse_encoder/pulse_encoder.md b/rt-thread-version/rt-thread-standard/programming-manual/device/pulse_encoder/pulse_encoder.md index 286f2a5c08a581047ae7500adeb5ab64eb8559aa..332d2bd07ea160593a86c0376ea411d0dad585a2 100644 --- a/rt-thread-version/rt-thread-standard/programming-manual/device/pulse_encoder/pulse_encoder.md +++ b/rt-thread-version/rt-thread-standard/programming-manual/device/pulse_encoder/pulse_encoder.md @@ -185,7 +185,7 @@ static int pulse_encoder_sample(int argc, char *argv[]) { rt_err_t ret = RT_EOK; rt_device_t pulse_encoder_dev = RT_NULL; /* 脉冲编码器设备句柄 */ - + rt_uint32_t index; rt_int32_t count; /* 查找脉冲编码器设备 */ @@ -204,7 +204,7 @@ static int pulse_encoder_sample(int argc, char *argv[]) return ret; } - for(rt_uint32 i; i <= 10; i++) + for (index = 0; index <= 10; index ++) { rt_thread_mdelay(500); /* 读取脉冲编码器计数值 */