in the motion sensor 2 example...
why we check the that if echo >120 is it to know that now signal was returned from the sensor so that we reset the timer again or what?
also is the variable "distance" that we obtain is ready to be used or we have to convert it to inches or cm's or to any other distance value we desire???
motion sensor 2 example
-
- Posts: 43
- Joined: Sat Sep 13, 2008 10:36 pm
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: motion sensor 2 example
Hello
Please could you attach the motion sensor program to the forum and I will have a look what it is doing for you.
Please could you attach the motion sensor program to the forum and I will have a look what it is doing for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 43
- Joined: Sat Sep 13, 2008 10:36 pm
- Contact:
Re: motion sensor 2 example
this is the motion sensor example ...
- Attachments
-
- MotionSensor2.fcf
- this the motion sensor example...
- (7 KiB) Downloaded 319 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: motion sensor 2 example
Hello
The distance variable is in mm and has a maximum range distance of 8000mm.
The If IrqCount > 120 command simply detects if the pulse has timedout without returning an echo. If this happens then we still calculate the distance before starting the detect process again.
The distance variable is in mm and has a maximum range distance of 8000mm.
The If IrqCount > 120 command simply detects if the pulse has timedout without returning an echo. If this happens then we still calculate the distance before starting the detect process again.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 43
- Joined: Sat Sep 13, 2008 10:36 pm
- Contact:
Re: motion sensor 2 example
Thank you for your help....
but can we change the distance "Range" of the sensor,why 8000mm why not more or less,also from telling that the if statement >120 so i also can control the timing of the pulses that the sensor sends each time...is that right?
and one last question do i have to use the CCP pin C2 or C3 or i can use another pin instead? because i need them for another operation "am using Pic16f877
but can we change the distance "Range" of the sensor,why 8000mm why not more or less,also from telling that the if statement >120 so i also can control the timing of the pulses that the sensor sends each time...is that right?
and one last question do i have to use the CCP pin C2 or C3 or i can use another pin instead? because i need them for another operation "am using Pic16f877
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: motion sensor 2 example
Hello
Im not too sure of all the details and Sean is away on holiday this week. The CCP input is neccisary as this is controlling the interrupt that is monitoring the responce from the sensor. 8000mm is probably the limit of the sensor. However I am not sure of this without digging in further. Have you looked at the sensor datasheet to see what it is capable of?
Im not too sure of all the details and Sean is away on holiday this week. The CCP input is neccisary as this is controlling the interrupt that is monitoring the responce from the sensor. 8000mm is probably the limit of the sensor. However I am not sure of this without digging in further. Have you looked at the sensor datasheet to see what it is capable of?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 43
- Joined: Sat Sep 13, 2008 10:36 pm
- Contact:
Re: motion sensor 2 example
thank you again for your fast response...
yes the sensor has a Min of 3 Cm and a Max of 4m distance detection with up to 1- 4 % of error,so it can detect objects more than 8000mm but how to do that using the flow code3 ?? may be by increasing the time that the echo nedded to be sent and received!!!
thank you again for your help....
take care
yes the sensor has a Min of 3 Cm and a Max of 4m distance detection with up to 1- 4 % of error,so it can detect objects more than 8000mm but how to do that using the flow code3 ?? may be by increasing the time that the echo nedded to be sent and received!!!
thank you again for your help....
take care
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: motion sensor 2 example
Hello
If the sensor is capable of a max sensing range of 4m and you are receiving 8000mm then that is equivalent to 8m. Sounds like it may be hard or impossible to push the range out any further.
If the sensor is capable of a max sensing range of 4m and you are receiving 8000mm then that is equivalent to 8m. Sounds like it may be hard or impossible to push the range out any further.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel