栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

51单片机undefined identifier问题求助

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

51单片机undefined identifier问题求助

程序如下

#include
#define uchar unsigned char
#define uint unsigned int

sbit tab=P3^2;
sbit start=P3^3;
bit timeover=0;

uchar led_count=0;
uchar disBuf[8];
uchar code disp_code[]=
    {
        0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,
        //0-9
        0x88,0x83,0xC6,0xA1,0x86,0x8E,
        //A B C D E F
        0x7F,0xBF,0x9C,0xFF
        //. - o null
    };

uint time,num=9999;
uint w1=0,w2=0,w3=0,w4=0;
unsigned int i,j;


void delay(uint del)
{
    for(;del>0;del--); 
}

void main(void)
{
disBuf[7]=19;
disBuf[6]=19;
disBuf[5]=19;
disBuf[4]=19;
disBuf[3]=10;
disBuf[2]=10;
disBuf[1]=10;
disBuf[0]=10;
while(1)
{
time=num;
do    {
    if(tab==0)
        {
        if(time!=9)
            time=time/10;
        else
            time=9999;
        }
    P0=0xFF;
    P1=~(1<<(led_count%8));
    P0=disp_code[disBuf[led_count%8]];
    led_count++;
    }
while(start==0);
num=time;

while(timeover=0)
    {
    while(time>0)
        {
                for(i=0;i<18879;i++)
                {
                    P0=0xff;
                    P1=~(1<<(led_count%8));
                    P0=disp_code[disBuf[led_count%8]];
                    led_count++;
                    w1=time%10;
                    w2=time/10%10;
                    w3=time/100%10;
                    w4=time/1000%10;
                    disBuf[3]=w4;
                    disBuf[2]=w3;
                    disBuf[1]=w2;
                    disBuf[0]=w1;
                }
                    time--;
        }
        timeover=1;
    }
}
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1001853.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号