各位,我在做一个摇摇棒,出现了这个怪问题,如下程序,在我的字模那里,从字模软件提取出来的“你”字就是love数组的第一部分,我注释掉的那里,但是这样只显示了“你”的单人旁。但是我把字模里的a到f换成数字,就是下面的没注释的字模,却显示出字来了。。。请问大家这是什么问题?而且显示的字的镜像的,然而未改前显示的单人旁却没有镜像,无论我有没有改if(flag == 0x00)为if(flag != 0x00)都一样。。。请问各位这是什么问题呢?
#include <iom16v.h>
#include <macros.h>
#define uint unsigned int
#define uchar unsigned char
uchar flag=0;
uchar t=0;
uchar i=0;
uchar k=0;
#pragma data:code
const uchar love[]={
/*
0x02,0x00,0x04,0x00,0x1f,0xff,0xe0,0x00,
0x02,0x00,0x04,0x10,0x18,0x20,0xf0,0xc2,
0x10,0x01,0x13,0xfe,0x10,0x00,0x10,0x80,
0x14,0x60,0x18,0x30,0x00,0x00,0x00,0x00
*/
0x02,0x00,0x04,0x00,0x18,0x88,0x80,0x00,
0x02,0x00,0x04,0x10,0x18,0x20,0x80,0x82,
0x10,0x01,0x13,0x88,0x10,0x00,0x10,0x80,
0x14,0x60,0x18,0x30,0x00,0x00,0x00,0x00
};
void delay(uchar x)
{
uchar y;
for(y=x;y>0;y--);
}
#pragma interrupt_handler display:2
void display()
{
flag = ~flag;
if(flag == 0x00)
{
delay(6000);
for(i=0;i<16;i++)
{
PORTA = 0xff;
PORTC = 0xff;
delay(1000);
PORTC = ~love[2*i];
PORTA = ~love[2*i+1];
delay(1000);
}
}
}
void main()
{
delay(5000);
SREG |= BIT(7);
MCUSR |= BIT(1);
GICR |= BIT(6);
flag = 0x00;
DDRA = 0xff;
DDRC = 0xff;
PORTA = 0xff;
PORTC = 0xff;
while(1);
} |