找回密码
 注册会员
更新自动建库工具PCB Footprint Expert 2024.04 Pro / Library Expert 破解版

望大侠指教(程序)

[复制链接]
admin 发表于 2012-9-3 01:33:27 | 显示全部楼层 |阅读模式

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有账号?注册会员

×
程序如下:
#include<reg51.h>
sbit P10 =0x90;
unsigned char dispbitcode[] ={0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff};
unsigned char dispcode[] ={0x8c,0x9e,0xbe,0xfc,0xbe,0x9e,0x8c,0xff};
unsigned char table[10][8]={  
{0x00,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00},
{0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00},
{0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00},
{0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00},
{0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00},
{0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00},
{0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00},
{0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00},
{0x00,0x00,0x36,0x49,0x49,0x49,0x36,0x00},
{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00}
};
unsigned char count,i,scnt;
void delay10ms(void)
{
unsigned char m,n;
for(m=20;m>0;m--)
for(n=248;n>0;n--);
}
void timer0() interrupt 1 using 0
{
TH0 =(65536-4000)/256;
TL0 =(65536-4000)%256;
P2 =dispbitcode[count];
P0 =table[i][count];
count++;
if(count==8)
{count =0;}
scnt++;
if(scnt==250)
{
i++;
if(i==10)
{i =0;}
}
}
void main(void)
{
unsigned char m;
TMOD =0x01;
TH0 =(65536-50000)/256;
TL0 =(65536-50000)%256;
ET0 =1;
EA =1;
while(1)
{
P0 =dispcode[m];
P2 =dispbitcode[m];
if(m==8)
{m =0;}
if(!P10)
{
delay10ms();
if(!P10)
{
TR0 =1;
}
}
}
}
问题是编译时出现 008.C(5): error C100: unprintable character 0xA1 skipped
008.C(5): error C100: unprintable character 0xA1 skipped此错误,应该怎样更改,谢谢了!
ding_yuxin 发表于 2014-3-7 00:32:24 | 显示全部楼层
P0 =dispcode[m];   中的m没赋值吧?
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

QQ|手机版|MCU资讯论坛 ( 京ICP备18035221号-2 )|网站地图

GMT+8, 2024-11-23 11:09 , Processed in 0.052299 second(s), 9 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表