#include<reg52.h>
sbit SDA=P3^2;
sbit STR=P3^1;
sbit SCK=P3^0;
void delay(int a)
{
int b,c;
for(b=0;b<a;b++)
{
for(c=0;c<125;c++)
{
}
}
}
unsigned char cot[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80},
hang[]= {0xbe,0xb6,0xb6,0xc9,0xc1,0xbe,0xbe,0xc1,//30
0x9d,0xae,0xb6,0xb9,0xf9,0xb6,0xb6,0xc1,//29
0x9d,0xae,0xb6,0xb9,0xc9,0xb6,0xb6,0xc9,//28
0x9d,0xae,0xb6,0xb9,0xfe,0xfe,0xfe,0x80,//27
0x9d,0xae,0xb6,0xb9,0xc3,0xb5,0xb6,0xce,//26
0x9d,0xae,0xb6,0xb9,0xb0,0xb6,0xb6,0x86,//25
0x9d,0xae,0xb6,0xb9,0xf0,0xf7,0xf7,0x80,//24
0x9d,0xae,0xb6,0xb9,0xbe,0xb6,0xb6,0xc9,//23
0x9d,0xae,0xb6,0xb9,0x9d,0xae,0xb6,0xb9,//22
0x9d,0xae,0xb6,0xb9,0xff,0xfb,0xfd,0x80,//21
0x9d,0xae,0xb6,0xb9,0xc1,0xbe,0xbe,0xc1,//20
0xff,0xfb,0xfd,0x80,0xf9,0xb6,0xb6,0xc1,//19
0xff,0xfb,0xfd,0x80,0xc9,0xb6,0xb6,0xc9,//18
0xff,0xfb,0xfd,0x80,0xfe,0xfe,0xfe,0x80,//17
0xff,0xfb,0xfd,0x80,0xc3,0xb5,0xb6,0xce,//16
0xff,0xfb,0xfd,0x80,0xb0,0xb6,0xb6,0x86,//15
0xff,0xfb,0xfd,0x80,0xf0,0xf7,0xf7,0x80,//14
0xff,0xfb,0xfd,0x80,0xbe,0xb6,0xb6,0xc9,//13
0xff,0xfb,0xfd,0x80,0x9d,0xae,0xb6,0xb9,//12
};
void chuyen(unsigned char x)
{
unsigned char temp,i;
for(i=0;i<8;i++)
{
temp=x&0x80;
if (temp==0x80)
SDA=1;
else SDA=0;
x=x*2;
SCK=0;
SCK=1;
}
}
void main(void)
{
int i,j,k;
while(1)
{
for(i=0;i<144;i++)
{
for(j=0;j<20;j++)
{
for(k=0;k<8;k++)
{
chuyen(hang[i+k]);
STR=0;
STR=1;
P2=cot[k];
delay(30);
P2=0xff;
}
}
}
}
}
hoan thanh di bai tap oi.c(73): error C249: 'DATA': SEGMENT TOO LARGE
giúp cái mọi người ơi cần hoàn thành bài tập sớm
sbit SDA=P3^2;
sbit STR=P3^1;
sbit SCK=P3^0;
void delay(int a)
{
int b,c;
for(b=0;b<a;b++)
{
for(c=0;c<125;c++)
{
}
}
}
unsigned char cot[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80},
hang[]= {0xbe,0xb6,0xb6,0xc9,0xc1,0xbe,0xbe,0xc1,//30
0x9d,0xae,0xb6,0xb9,0xf9,0xb6,0xb6,0xc1,//29
0x9d,0xae,0xb6,0xb9,0xc9,0xb6,0xb6,0xc9,//28
0x9d,0xae,0xb6,0xb9,0xfe,0xfe,0xfe,0x80,//27
0x9d,0xae,0xb6,0xb9,0xc3,0xb5,0xb6,0xce,//26
0x9d,0xae,0xb6,0xb9,0xb0,0xb6,0xb6,0x86,//25
0x9d,0xae,0xb6,0xb9,0xf0,0xf7,0xf7,0x80,//24
0x9d,0xae,0xb6,0xb9,0xbe,0xb6,0xb6,0xc9,//23
0x9d,0xae,0xb6,0xb9,0x9d,0xae,0xb6,0xb9,//22
0x9d,0xae,0xb6,0xb9,0xff,0xfb,0xfd,0x80,//21
0x9d,0xae,0xb6,0xb9,0xc1,0xbe,0xbe,0xc1,//20
0xff,0xfb,0xfd,0x80,0xf9,0xb6,0xb6,0xc1,//19
0xff,0xfb,0xfd,0x80,0xc9,0xb6,0xb6,0xc9,//18
0xff,0xfb,0xfd,0x80,0xfe,0xfe,0xfe,0x80,//17
0xff,0xfb,0xfd,0x80,0xc3,0xb5,0xb6,0xce,//16
0xff,0xfb,0xfd,0x80,0xb0,0xb6,0xb6,0x86,//15
0xff,0xfb,0xfd,0x80,0xf0,0xf7,0xf7,0x80,//14
0xff,0xfb,0xfd,0x80,0xbe,0xb6,0xb6,0xc9,//13
0xff,0xfb,0xfd,0x80,0x9d,0xae,0xb6,0xb9,//12
};
void chuyen(unsigned char x)
{
unsigned char temp,i;
for(i=0;i<8;i++)
{
temp=x&0x80;
if (temp==0x80)
SDA=1;
else SDA=0;
x=x*2;
SCK=0;
SCK=1;
}
}
void main(void)
{
int i,j,k;
while(1)
{
for(i=0;i<144;i++)
{
for(j=0;j<20;j++)
{
for(k=0;k<8;k++)
{
chuyen(hang[i+k]);
STR=0;
STR=1;
P2=cot[k];
delay(30);
P2=0xff;
}
}
}
}
}
hoan thanh di bai tap oi.c(73): error C249: 'DATA': SEGMENT TOO LARGE
giúp cái mọi người ơi cần hoàn thành bài tập sớm
Comment