欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 求修改程序 error C267: 'write_date': requires ANSI-style prototype [打印本頁]

作者: 122429    時間: 2019-8-4 16:11
標(biāo)題: 求修改程序 error C267: 'write_date': requires ANSI-style prototype
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
   
uchar code table0[]="Welcome!";
uchar code table1[]="I Love You!";

uchar num;
sbit lcden=P2^2;                //液晶使能端   
sbit lcdrs=P2^0;               //液晶數(shù)據(jù)命令選擇端
//聲明子函數(shù)
void delayms(uint xms);            //延時函數(shù)
void write_com(uchar com);         //液晶寫命令函數(shù)
void write_data(uchar date);        //液晶寫數(shù)據(jù)函數(shù)     
void led_init();                //液晶初始化函數(shù)
void t_init();                    //定時器0初始化函數(shù)   

void delayms(uint xms)//延時函數(shù)
{
    uint i,j;
    for(i=xms;i>0;i--)
    for(j=110;j>0;j--);     //11.0592MHZ
}
               
void write_com(uchar com)//液晶寫命令函數(shù)
{
    lcdrs=0;
    P0=com;
    delayms(5);
    lcden=1;
    delayms(5);
    lcden=0;
}
               
void write_data(uchar date)//液晶寫數(shù)據(jù)函數(shù)     
{
    lcdrs=1;
    P0=date;
    delayms(5);
    lcden=1;
    delayms(5);
    lcden=0;
}

void led_init()//液晶初始化函數(shù)
{
    lcden=0;
    write_com(0x38);            //設(shè)置16×2顯示,5×7點陣,8位數(shù)據(jù)接口            
    write_com(0x0c);            //設(shè)置開顯示,不顯示光標(biāo)        
    write_com(0x06);            //寫一個字符后地址指針加1        
    write_com(0x01);            //顯示清0,數(shù)據(jù)指針清0        
    //write_com(0x80);            //顯示歡迎界面
}

void main()
{
    led_init();
    write_com(0x80);
    for(num=0;num<11;num++)
    {
        write_date(table0[num]);
        delayms(5);
    }
    write_com(0x80+0x40);
    for(num=0;num<13;num++)
    {
        write_date(table1[num]);
        delayms(5);
    }
    while(1);
}





Rebuild target 'Target 1'
assembling STARTUP.A51...
compiling 1602.c...
1602.c(61): warning C206: 'write_date': missing function-prototype
1602.c(61): error C267: 'write_date': requires ANSI-style prototype
Target not created.
Build Time Elapsed:  00:00:02



作者: 沒有你    時間: 2019-8-5 09:05
兄弟,你也太粗心了吧,前面write_data(),后面是write_date();本來就不同的函數(shù),你把最后的“data”寫成“date”了




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1