gurjant.sandhu33
- Dec 10, 2013
- 51
- Joined
- Dec 10, 2013
- Messages
- 51
i have made an ir sensor obstacle detector for pic 16f870 and written code for it. it is working but its range is very less only about 3cm. is there any way to improve the range and also can i use some other sensor to improve its range. i want about 4 m range.
this is the code-
void main()
org 0x10
{
TRISB=0x00;
trisc=0xff;
while(1)
{
if(portc.f0 == 0)
{
portb.f0=1; //on when there is interference
delay_ms(2000);
}
if(portc.f0 == 1)
{
portb.f0=0;
}
}
}
this is the code-
void main()
org 0x10
{
TRISB=0x00;
trisc=0xff;
while(1)
{
if(portc.f0 == 0)
{
portb.f0=1; //on when there is interference
delay_ms(2000);
}
if(portc.f0 == 1)
{
portb.f0=0;
}
}
}