单片机技术网|技术阅读
登录|注册

您现在的位置是:单片机技术网 > 技术阅读 > 基于51单片机的智能雨刷设计

基于51单片机的智能雨刷设计

.

   


   51++1602+湿+ADC0832+

.

1lcd1602

2adc0832ad

312

4

.

1AD,

2PCB

.

1

2

void main() { water_h=byte_read(0x2000); water_l=byte_read(0x2200); if(water_h<water_l||water_h>100||water_l<0) { water_h=60; water_l=10;  }  TMOD=0x11; TH1=0x3c; TL1=0xb0; TH0=0x3c; TL0=0xb0; ET1=1;
ET0=1; EA=1;
TR0=1; TR1=1; LCD1602_cls(); while(1) { if(A_M==0)      {  police_dispose(); if(star_off==0)       {               if(DJ_dat==0) loop=0; while(DJ_dat<180) { P1=P1&0xf0|zz[loop]; loop=(loop+1)%8; if(loop==0) DJ_dat++; LCD1602_delay(Value); } if(DJ_dat==120)loop=0; while(DJ_dat!=0) { P1=P1&0xf0|fz[loop]; loop=(loop+1)%8; if(loop==0) DJ_dat--; LCD1602_delay(Value); } } } else {
if(speed_flag!=0) { if(star_off==0) { if(DJ_dat==0) loop=0; while(DJ_dat<180) { P1=P1&0xf0|zz[loop]; loop=(loop+1)%8; if(loop==0) DJ_dat++; LCD1602_delay(Value); } if(DJ_dat==120)loop=0; while(DJ_dat!=0) { P1=P1&0xf0|fz[loop]; loop=(loop+1)%8; if(loop==0) DJ_dat--; LCD1602_delay(Value); } } } else { loop=0; DJ_dat=0;        } } } //1 }