基于单片机红外自动触发计时器protues仿真
【资源下载】下载地址如下1400:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include<reg51.h> //---重定义关键词---// #ifndef uchar #define uchar unsigned char #endif #ifndef uint #define uint unsigned int #endif //--定义使用的IO口--// #define GPIO_DIG P0 sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; sbit K1=P3^5; //圈数设置 sbit K2=P3^6; //圈数确定 sbit K3=P3^7; //清零 unsigned int Time; unsigned int sec=0; unsigned char countset=1; char count; //--定义全局变量--// unsigned char code DIG_PLACE[8] = { 0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//位选控制 查表的方法控制 unsigned char code DIG_CODE[17] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00}; //0、1、2、3、4、5、6、7、8、9、A、b、C、d、E、F的显示码 unsigned char DisplayData[8]; //用来存放要显示的8位数的值