sensor using basic stamp
hai...
i had bought an obstacle sensor and it happens that the source code is in basic stamp
I've tried to code it in c compiler...
but it won't work very nicely...
i want to ask a favor if u could help me translating it into c compiler programme using ccs.....
if u could...
i would provide the datasheet...which is irpd ver 3.0 detector.....
anyone...
please help...i need it urgently..
im having the project presentation soon...
thanks....
i had bought an obstacle sensor and it happens that the source code is in basic stamp
I've tried to code it in c compiler...
but it won't work very nicely...
i want to ask a favor if u could help me translating it into c compiler programme using ccs.....
if u could...
i would provide the datasheet...which is irpd ver 3.0 detector.....
anyone...
please help...i need it urgently..
im having the project presentation soon...
thanks....
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... Smile, there went another one.
i'll
give u the datasheet...
the basic stamp source code is at the last page of the datasheet..
thank u very much..
i appreciate ur help
http://www.lynxmotion.com/images/data/irpd-v7.pdf
i u need more info,just tell me.
thanks again...
"do u mind writing the pseudo code"thanks
Post Edited (budakentang89) : 5/14/2010 2:34:03 AM GMT
What chip are you coding for?
How are you connected to the device? Which pins where?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
i have set tris the pin c for the both leds (right and left)"default".
d7 for signal.
c4 and c5 for output which is led but i want to change the output to servo motor later..(servo motor codes r completed yesterday)
c0 and c1 to set the right and left led to default.
here r the codes which i make with led as output ."later after sensor completed,i want to change the output to servo motor.
#include<16f877a.h>
#use delay(clock=20000000)
#fuses hs,noprotect,nowdt,nolvp
#byte portc=7
#byte portd=8
void main()
{
set_tris_c(0b00000000);
set_tris_d(0b10000000);
do{
//
//detect left//
output_high(pin_c0);//left
output_low(pin_c1);//right
if(input(pin_d7)==0)
{
output_high(pin_c4);
output_low(pin_c5);
}
if(input(pin_d7)==1)
{
output_low(pin_c4);
output_low(pin_c5);
}
//
//detect right//
output_low(pin_c0);//left
output_high(pin_c1);//right
if(input(pin_d7)==0)
{
output_low(pin_c4);
output_high(pin_c5);
}
if(input(pin_d7)==1)
{
output_low(pin_c4);
output_low(pin_c5);
}
}while(1);
}
thank you..