本帖最后由 FSL_TICS_A 于 2014-10-8 09:41 编辑
#include <mc9s12xs128.h>
#include "derivative.h"
void main (void)
{
char a;
DDRA=0xFF;
a = 0;
while(1)
{
PORTA = 0x00;
switch (a)
{
case 0:
PORTA = 0x01;
case 1:
PORTA = 0x02;
case 2:
PORTA = 0x04;
case 3:
PORTA = 0x08;
case 4:
PORTA = 0x10;
case 5:
PORTA = 0x20;
case 6:
PORTA = 0x40;
case 7:
PORTA = 0x80;
default:PORTA = 0x00
};
a+1;
if(a = 8);
{
a=0;
};
delay(500) ;
}
}
程序说结束大括号后面分号丢失,结束错误
肿么办 |