uint time_001s =0; uchar guang =0;//系统初始化voidInitsys();//配置HC138voidSelectHC138(uchar channel);//在pos位码上,显示value段码voidDisplaySMG_Bit(uchar pos, uchar value);//数码管8位码显示voidSMG_Display();//数码管的延时voidDelay_one_ms_SMG();//独立按键(BTN)voidAlone_Key();/...
void InitTimer0(); //售水机出水 void Mod_1_Strat(); //售水机停水 void Mod_2_Stop(); //PCF8591 uchar IIC_read(uchar add); //光感处理 void Light_Check(); void main() { Initsys(); InitTimer0(); while(1) { Light_Check(); //Matrix_Key(); Alone_Key(); //SMG_Display();...
简介:蓝桥杯之单片机学习(二十一)——自动售水机(附题目和完整代码) 一、题目要求 二、代码展示 #include <STC15F2K60S2.h>#include "iic.h"#define uchar unsigned char#define uint unsigned intuchar code SMG_duanma[18] ={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x80,0x...