#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
/***************引脚声明*********************/
#define lcd P0
sbit rs=P2^7; //LCD液晶控制端
sbit en=P2^6;
sbit SPK=P1^7; //蜂鸣器引脚
sbit CS=P1^2; //将CS位定义为P1.2引脚
sbit CLK=P1^0; //将CLK位定义为P1.0引脚
sbit DIO=P1^1; //将DIO位定义为P1.1引脚
sbit key=P2^5; //定义按键引脚
sbit a=P2^0; //模拟量通道选择端
sbit b=P2^1; //模拟量通道选择端
sbit c=P2^2; //模拟量通道选择端
sbit LED = P3^7;
sbit LED1 = P3^6;
/***********LCD显示数组**************************/
uchar table1[]="V=0.00V";
uchar table3[]="I=0.00A";
uchar table5[]="PO=000%";
uchar table6[] = "T=000C";
uchar temp = 0;
uchar tt = 0;
/***************全局变量************************/
uchar flag=0; //换挡标志位
void delay(uint count) //延时
{
uint i,j;
基于单片机蓄电池充放电检测系统设计-毕设资料
最新推荐文章于 2024-04-10 11:01:25 发布