标签:pos cpp sign long bsp class 传感器 mod reg
【资源下载】下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include <reg52.H>//器件配置文件 #include <intrins.h> //传感器接口 sbit RX = P3^2; sbit TX = P3^3; //按键声明 sbit S1 = P1^4; sbit S2 = P1^5; sbit S3 = P1^6; //蜂鸣器 sbit Feng= P2^0; sbit W1=P1^0; sbit W2=P1^1; sbit W3=P1^2; sbit W4=P1^3; //变量声明 unsigned int time=0; unsigned int timer=0; unsigned char posit=0; unsigned long S=0; unsigned long BJS=50;//报警距离80CM //模式 0正常模式 1调整 char Mode=0; bit flag=0; bit flag_KEY=0; unsigned char const discode[] ={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x40,0xff/*-*/}; //数码管显示码0123456789-和不显示 //unsigned char const positon[4]={0xfd,0xfb,0xf7,0xfe}; //位选 unsigned char disbuff[4] ={0,0,0,0}; //数组用于存放距离信息 unsigned char disbuff_BJ[4] ={0,0,0,0};//报警信息 void Display(); //延时20ms(不精确)
标签:pos cpp sign long bsp class 传感器 mod reg
原文地址:https://www.cnblogs.com/ythero/p/14513684.html