adding the LCD display on circuit !
Fri May 18 2012, 01:49 am
make sure you attach only file formats that are supported. if its a c file then better zip it and then attach.
Sat May 19 2012, 08:47 pm
#include<reg51.h>
#define input P1
sbit output = P3^6;
sbit wr= P3^3;
sbit rd= P3^4;
sbit intr= P3^5;
void pwmm(int i);
void delay(unsigned int n )
{
int i ,j ;
for(i=0;i<n;i++)
for(j=0; j<1275; j++);
}
void main()
{
int temp;
input=0xff;
wr=0;
rd=0;
intr=1;
while(1)
{
rd=1;
wr=0;
wr=1;
while(intr==1);
rd=0;
temp=input;
intr=1;
if(input>0&&input<20)
{
output=0;
}
else if(input>20&&input<30)
{
pwmm(6);
}
else
{
pwmm(10);
}
}
}
void pwmm(int i)
{ int j,k;
output=1;
for(j=0;j<i;j++)
delay(5);
k=10-i;
output=0;
for(j=0;j<k;j++)
delay(5);
}
#define input P1
sbit output = P3^6;
sbit wr= P3^3;
sbit rd= P3^4;
sbit intr= P3^5;
void pwmm(int i);
void delay(unsigned int n )
{
int i ,j ;
for(i=0;i<n;i++)
for(j=0; j<1275; j++);
}
void main()
{
int temp;
input=0xff;
wr=0;
rd=0;
intr=1;
while(1)
{
rd=1;
wr=0;
wr=1;
while(intr==1);
rd=0;
temp=input;
intr=1;
if(input>0&&input<20)
{
output=0;
}
else if(input>20&&input<30)
{
pwmm(6);
}
else
{
pwmm(10);
}
}
}
void pwmm(int i)
{ int j,k;
output=1;
for(j=0;j<i;j++)
delay(5);
k=10-i;
output=0;
for(j=0;j<k;j++)
delay(5);
}
[ Edited Sat May 19 2012, 08:48 pm ]
Sun May 20 2012, 10:40 am
In above code u need to add LCD functions?
Define your LCD port pins as u did for ADC.
Just have look at this tutorial http://www.8051projects.net/lcd-interfacing/
Define your LCD port pins as u did for ADC.
Just have look at this tutorial http://www.8051projects.net/lcd-interfacing/
Powered by e107 Forum System