- This topic has 2 replies, 3 voices, and was last updated 10 years, 2 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › 89c2051 controller
hay every one i have compiled a code for interfacing of optical sensor and metal detector to control relay i am usng 89c2051 controller but problem is that i am tring to change the out put of controller with the out put of comparator plz help me and code is
#include<AT89X51.h>
sbit pro=P3^0;
sbit eye=P3^1;
sbit out1=P1^3;
sbit out2=P1^2;
sbit an1=P1^0;
sbit an2=P1^1;
sbit out3=P3^6;
void delay(unsigned int limit)
{
int i,j;
for(i=0;i<limit;i++)
{
for(j=0;j<1275;j++);
}
}
void main()
{
while(1)
{
pro=1;
eye=1;
an1=an2=out3=1;
if(pro==1&&eye==0&&out3==0)
{
out2=0;
delay(200);
out2=1;
}
else if(pr0==1;&&eye==0&&out3==1)
out2=0;
}
while(pro==0&&eye==1)
{
out2=1;
out1=0;
delay(200);
out1=0;
}
while (pro==0&&eye==0)
{
out1=0;
out2=0;
}
}
}
end;
plz help me
Hi,
“problem is that i am tring to change the out put of controller with the out put of comparator” ……. and what happens when you try that, what result are you expecting??
pls post your circuit diagram also
that makes easy to understand ur program code