Wireless Tachometer

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Wireless Tachometer as PDF for free.

More details

  • Words: 147
  • Pages: 2
#include void lcd_cmd(unsigned char); void lcd_data(unsigned char); void lcd_convert(unsigned long); unsigned long count=0; unsigned int val=0; unsigned long sol; sbit rs sbit rw sbit en

=P2^4; =P2^5; =P2^6;

void main() { lcd_cmd(0x38); lcd_cmd(0x01); lcd_cmd(0x84); lcd_cmd(0x0f); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); lcd_data('0'); TMOD =0x16; IE =0x8A; IP =0x02; TH0 =0xff; TL0 =0xff; TH1=TL1 =0; TR0 =1; while(1); } void timer1(void) interrupt 3 { count++; } void counter0(void) interrupt 1 { EA=0; TR1=TR0=0; val=TL1; val|=(TH1<<8); sol=60000000/(((65536*count)+val)*1.085); lcd_convert(sol); count=0; val=0; TH1=TL1=0; TR1=TR0=1; EA=1;

} void lcd_cmd(unsigned char dat) { unsigned int c; P0=dat; rs=0; rw=0; en=1; for(c=0;c<2000;c++); en=0; } void lcd_data(unsigned char dat) { unsigned int c; P0=dat; rw=0; rs=en=1; for(c=0;c<2000;c++); en=0; } void lcd_convert(unsigned long da) { unsigned long a,b,c,d,e,f,g,h,i,j,k,l,m,n;

}

a=da/10; b=da%10; c=a/10; d=a%10; e=c/10; f=c%10; g=e/10; h=e%10; i=g/10; j=g%10; k=i/10; l=i%10; m=k%10; n=k/10; lcd_cmd(0x01); lcd_cmd(0x84); lcd_data(n|0x30); lcd_data(m|0x30); lcd_data(l|0x30); lcd_data(j|0x30); lcd_data(h|0x30); lcd_data(f|0x30); lcd_data(d|0x30); lcd_data(b|0x30);

Related Documents

Wireless Tachometer
June 2020 0
Wireless Tachometer
June 2020 1
Wireless Tachometer
June 2020 0
Wireless
December 2019 39
Wireless
October 2019 41