该程序功能上还有一定的缺陷,带晚上,初步实现功能
//待完善
#include <pic.h>
#include "../head/config.h"
__CONFIG(HS&WDTDIS&LVPDIS&PWRTEN);//对熔丝位进行设置
//单片机LED共阳极段码表(带小数点) 0~9
const char table1[]={0X0A,0XFA,0X8C,0XA8,0X78,0X29,0X09,0XBA,0X08,0X28,0x18,0x49,0x0f,0xc8,0x0d,0x1d};
//数码管位码表
const char table[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unsigned int result = 0,lastresult = 0;
uchar data_temp = 0;
void delay(void); //delay函数申明
void init(void); //I/O口初始化函数申明
void scan(void); //按键扫描程序申明
void display(void); //显示函数申明
void SPI_tx(uchar spi_data);
//---------------------------------------------------
|