我已经编写了这段代码,但在编译时,我收到以下语句的“无效表达式”消息
unsigned short address[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/*array is being initialized here.no problem uptil here.*/
unsigned short rowHead=3;
unsigned short colHead=0;
unsigned short rowTail =0;
unsigned short colTail =0;
unsigned short foodx;
unsigned short foody;
unsigned short turn=0;
void gameOver()
{
unsigned short i=0;
address[] ={0b10000001,0b01000010,0b00100100,0b00011000,
0b00011000,0b00100100,0b01000010,0b10000001};
/*this is the line where compiler complaints as invalid expression.*/
while(1)
{
PORTD &=~(1<<i);
PORTB =address[i];
delay_ms(5);
PORTD |=1<<i;
i%8;
}
}