这是我在你这买的msp430 步进电机的代码。运行出错
#include <msp430x14x.h>
#define DCO_FREQ 1000000 // DCO frequency
#define ONE_SEC_CNT 512 // Number of WDT interrupts in 1 second
#define DEBOUNCE_CNT 0x05 // (1/512)*5 = ~10 msec debounce
#define DIR_MASK 0x01 // 0x01 is clockwise, 0x00 is counter-clockwise
#define STEP_MASK 0x02 // 0x00 is full-stepping, 0x02 is half-stepping
#define MOTION_MASK 0x04 // 0x00 is continuous, 0x04 is single-step
#define DEFAULT_RA TE 0x8000 // Default stepping rate
#define MIN_RATE 0x8000 // Minimum stepping rate
#define MAX_RATE 0x0800 // Maximum stepping rate
// Default state is full-stepping, clockwise, continuous
unsigned char state = 1; // State variable
unsigned char stepIndex = 0; // State table index
unsigned int rate = DEFAULT_RA TE; // Stepping rate
unsigned char change_rate_flag = 0; // Flag indicating rate change
Error[Pe020]: identifier "TE" is undefined
Error[Pe065]: expected a ";"
Error[Pe020]: identifier "MAX_RA" is undefined
Error[Pe065]: expected a ";"
Error[Pe020]: identifier "MIN_RA" is undefined
Error[Pe065]: expected a ";"
Error[Pe020]: identifier "DIV" is undefined
Error[Pe065]: expected a ";"
Error[Pe065]: expected a ";"
1.DEFAULT_RA TE 变量定义不能带空格;
2.MAX_RA,MIN_RA,DIV提示没定义,是不是对应上边定义的MIN_RATE,MAX_RATE,你下边程序写错了;
3.还有位置可能丢了分号,最好把程序全部展现出来;