bing2005
Junior Member level 2
I want to capture signal from the 40KHz ultrasonic transducer with the capture module.
But, i cannot capture the signal from the ultrasonic transmitter.
The capture part source code is shown as below:
I try to capture the falling edge and rising edge then store the time, and use the time to calculate the distance.
Thanks guys!!![/code]
But, i cannot capture the signal from the ultrasonic transmitter.
The capture part source code is shown as below:
Code:
void capture(void)
{
if(RC2==0)
{
RB4 = 1;
CCP1CON = 0x04;
TMR1ON = 0;
}
if(RC2==1)
{
RB5 = 1;
CCP1CON = 0x05;
TMR1ON = 1;
}
}
I try to capture the falling edge and rising edge then store the time, and use the time to calculate the distance.
Thanks guys!!![/code]