声明:1、我发布程序旨在希望大家蓝桥杯单片机比赛可以取得好成绩
2、在看我程序之前希望大家先去B站观看完小蜜蜂老师的蓝桥杯单片机视频讲解
小蜜蜂视频链接:【小蜜蜂笔记】蓝桥杯大赛-单片机设计与开发基础技能与进阶强化教程_哔哩哔哩_bilibili
本程序资源包采用第十三届蓝桥杯资源包
本博客包含第八届到第十三届蓝桥杯单片机真题所有程序
main.c
#include <reg52.h>
#include <iic.h>
sfr P4 = 0xc0;
sbit R1 = P3^0;
sbit R2 = P3^1;
sbit R3 = P3^2;
sbit R4 = P3^3;
sbit C1 = P3^4;
sbit C2 = P3^5;
sbit C3 = P4^2;
sbit C4 = P4^4;
sbit L1 = P0^0;
sbit L2 = P0^1;
sbit L3 = P0^2;
//变量区
unsigned char flag_2 = 0;
unsigned char flag_3 = 0;
unsigned char count_LED = 0;
unsigned int count1 = 0;
unsigned char flag_LED = 0;
unsigned char state_1 = 1;//界面切换
unsigned char count = 0;//计数
signed int number;//电压参数
unsigned int Rb3 = 0;
unsigned char SMG_val[10] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
//锁存器的选择
void SelectHC573(unsigned char ch