亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码

標題: 這個錯誤main.c(24): error C267: 'Nixie_Scan': requires ANSI-style prototype [打印本頁]

作者: 錢汝士    時間: 2026-5-16 13:42
標題: 這個錯誤main.c(24): error C267: 'Nixie_Scan': requires ANSI-style prototype
#include <REGX52.H>
#include "Delay2.h"
#include "key.h"
#include "Nixie.h"
#include "Timer0.h"

sbit LED=P2^0;
unsigned char Counter,Compare;
unsigned char KeyNum;
unsigned char Speed;

void main(){

                Timer0_Init();
                Compare=50;
        while(1){
                Key_Loop();
                KeyNum=key();
                if(KeyNum==1){
                        Speed++;
                        Speed%=4;
                }
                Nixie_Loop();
                Nixie_Scan(1,Speed);
        }
}

void Timer0_Routine()   interrupt 1{
                TL0=0x9C;                //設定定時始值
                TH0=0xFF;                //設定定時初值
                Counter++;
                Counter%=100;
        if(Counter<Compare)LED=0;
        else LED=1;
}

下面是函數
#include <REGX52.H>
#include "Delay.h"
unsigned char Nixie_Buf[9]={0,10,10,10,10,10,10,10,10};
unsigned char Nixietable[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x00};

void Nixie_Scan (unsigned char location,unsigned char num){
                switch(location){
                        case 1:P2_4=1,P2_3=1,P2_2=1;break;
                        case 2:P2_4=1,P2_3=1,P2_2=0;break;//led7
                        case 3:P2_4=1,P2_3=0,P2_2=1;break;//led6
                        case 4:P2_4=1,P2_3=0,P2_2=0;break;//led5
                        case 5:P2_4=0,P2_3=1,P2_2=1;break;//led4
                        case 6:P2_4=0,P2_3=1,P2_2=0;break;//led3
                        case 7:P2_4=0,P2_3=0,P2_2=1;break;//led2
                        case 8:P2_4=0,P2_3=0,P2_2=0;break;
       
                }
        P0=Nixietable[num];
        Delay(1);
        P0=0x00;
        }       

void Nixie_Loop(){
                static unsigned char i=0;
                Nixie_Scan(i,Nixie_Buf[i]);
                i++;
                if(i>8)i=0;
        }


       
       
void Nixie_SetBuf(unsigned char location,number){
        Nixie_Buf[location]=number;
}
       

       
       

下面是.h文件
#ifndef __NIXIE_H__
#define __NIXIE_H__

void Nixie_Scan (unsigned char location,num);
void Nixie_Loop();
void Nixie_SetBuf(unsigned char location,number);

#endif




作者: 錢汝士    時間: 2026-5-16 13:43
聲明也聲明了,定義也定義了,調用為什么就不行了
作者: 錢汝士    時間: 2026-5-16 14:39
為什么把這個Nixie的.c和.h文件放在同一個文件夾就好了
作者: ydatou    時間: 2026-5-23 17:20
錢汝士 發表于 2026-5-16 14:39
為什么把這個Nixie的.c和.h文件放在同一個文件夾就好了

不放同一文件夾也可以,但要把.h文件所在文件夾配置到“include paths”。
這是項目配置的常規操作,你應該要掌握。
作者: Hephaestus    時間: 2026-5-24 14:53
ydatou 發表于 2026-5-23 17:20
不放同一文件夾也可以,但要把.h文件所在文件夾配置到“include paths”。
這是項目配置的常規操作,你 ...

也不對啊,按你的猜測應該報沒找到頭文件錯誤。




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