/#include <string.h>
#include <stdio.h>
typedef struct {
//unsigned long int motor_runned; //运行了多少脉冲
unsigned char motor_angle; //转过了多少角度,motor_runned/1000*360
unsigned char motor_dir; //0为顺时针,1为逆时针
unsigned int motor_speed;
}motor_sta;
void main()
{
motor_sta motor1= {0,0,0,0};
motor_sta * motor1_ptr = & motor1;
motor_ptr->motor_dir=1;
//printf("dir=%d\n",motor_ptr->motor_dir);
while(1);
为什么报错了呢? |