雨刮器C语言编程,基于51单片机的智能雨刮器Proteus仿真程序设计

该博客介绍了如何使用C语言在51单片机上编程实现智能雨刮器的控制。通过不同的延时函数,实现了电机正转、反转和停止,以适应不同雨量的刮刷速度需求。程序中还包含了LCD显示功能,用于实时显示雨量数据。
摘要由CSDN通过智能技术生成

#include

#include

#include

#define uchar unsigned char

#define uint unsigned int

//********正转**********

unsigned char code FFW[8]={0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09};

//********反转**********

unsigned char code REV[8]={0x09,0x01,0x03,0x02,0x06,0x04,0x0c,0x08};

//********数组**********

uchar shuzu[]={0x00,0x00,0x00};

sbit RS=P1^7;

sbit RW=P1^6;

sbit E=P1^5;

sbit ST=P3^0;

sbit OE=P3^1;

sbit EOC=P3^2;

sbit CLK=P3^7;

uchar getdata;

uchar temp;

uchar flag;

//*********延时**********

void delay(unsigned int t)

{

unsigned int k;

while(t--)

{

for(k=0; k<125; k++)

;

}

}

void delaynms(uint aa)

{

uchar bb;

while(aa--)

{

for(bb=0;bb<115;bb++)     //1ms基准延时程序

{

;

}

}

}

//*********LCD显示*********

void fbusy()//查忙

{

P2=0xff;RS=0;RW=1;

E=0;E=1;

while(P2&0x80){E=0;E=1;}

}

void wr51r(uchar j)//写命令

{

fbusy();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值