poojaghorpade
Newbie level 4
- Joined
- Feb 24, 2014
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 71
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 #include<reg51.h> #include<stdio.h> #include<string.h> #ifdef reg51.h sbit rs=P2^2; sbit rw=P2^1; sbit en=P2^0; sbit busy=P0^7; void lcdready(); int lcdcmd(unsigned int a); int lcddata(unsigned char a); int delay(unsigned int x); int display(unsigned char); void ascii(unsigned char value); unsigned char msg[]={"counter"}; int lcdcmd(unsigned int a) { lcdready(); P0=a; rs=0; rw=0; en=1; delay(1); en=0; return; } int lcddata(unsigned char a) { lcdready(); P0=a; rs=1; rw=0; en=1; delay(1); en=0; return; } void lcdready() { busy=1; rs=0; rw=1; while(busy==1) { en=0; delay(1); en=1; } return; } int display(unsigned char msg[]) { unsigned char i=0; while(msg[i]!='\0') { lcddata(msg[i]); i++; } i=0; return; } int delay(unsigned int x) { unsigned int i,j; for(i=0;i<=x;i++) { for(j=0;j<=125;j++) } } void main() { lcdcmd(0x38); lcdcmd(0x0e); lcdcmd(0x01); lcdcmd(0x06); lcdcmd(0x80); display(msg); T1=1; TMOD=0x60; TH0=0; while(1); { do { TR0=1; value=TL0; ascii(value); } while(TF0==0); TR0=0; TF0=0; } } void ascii(unsigned char value) { unsigned char x,d1,d2,d3; x=value/10; d1=value%10; d2=x%10; d3=x/10; P0=30|d1; P1=30|d2; P2=30|d3; }