Hello Everyone,
"Why make it difficult when it can be easy!!" my wife often says to me.
This way I now measure a distance of 1 meter. Theoretically that is 5847 uS 
and I measure 5813!!
No problem to put this three times in one IC!!!!!
---------------------------------------------------------------------------------
const STOPWATCH_MIN_VALUE = STOPWATCH_US -- (STOPWATCH_NS is default if not 
defined)
const STOPWATCH_USE_TIMER = 1 -- (1 is default if not defined)
include stopwatch
stopwatch_init()

procedure is DISTANCE_2
distance_L = 0
TRG_L=high
delay_10uS(3)
TRG_L=low
 while ECH_L == low loop end loop
 stopwatch_start()
 while ECH_L == high loop end loop
 stopwatch_stop()
 distance_L = stopwatch
end procedure

She was right again!!
Greetings
Hans

Op vrijdag 11 april 2025 om 19:15:52 UTC+2 schreef Hans van Veldhuizen:

> Hi Rob,
> I'll stick with my old approach. It's well within the range of the sensors 
> themselves. Thanks again for the effort you've made for me.
>  Good luck with your car.
> goeten
> Hans
>
> Op vrijdag 11 april 2025 om 13:11:53 UTC+2 schreef Rob CJ:
>
>> Hi Hans,
>>
>> The library also supports the use of an interrupt on change pins and in 
>> your case that would be pin_B6. But I saw that the PIC you are using uses 
>> IOC differently so I think that will not work.
>>
>> You are currently using pin_B0 as chip select. Can't you change that to 
>> any other pin so that B0 can be used as interrupt?
>>
>> BTW: I posted the Self Driving Robot Wagon as a project on Youtube for 
>> anybody who want to build it and to promote JAL: 
>> https://www.youtube.com/watch?v=EaIO6-hiUwA
>>
>> Kind regards,
>>
>> Rob
>>
>> ------------------------------
>> *Van:* [email protected] <[email protected]> namens Hans van 
>> Veldhuizen <[email protected]>
>> *Verzonden:* vrijdag 11 april 2025 11:36
>>
>> *Aan:* jallib <[email protected]>
>> *Onderwerp:* Re: [jallib] hcsr04 3x
>> Rob, 
>> Cannot use this , pin_B0 is attached  to the display.
>>
>>  Have tried to convert your sample. Loaded in another set. I got a lot of 
>> strange characters,.
>>
>>
>> Op vrijdag 11 april 2025 om 07:51:52 UTC+2 schreef Rob CJ:
>>
>> Hi Hans,
>>
>> Forgot to mention. The echo pin must be connected to pin_b0, the INT pin 
>> of th 16F877a.
>>
>> The trigger pin is the same.
>>
>> And there was a type so attached with the fix.
>>
>> Kind regards,
>>
>> Rob
>>
>> ------------------------------
>> *Van:* [email protected] <[email protected]> namens Rob CJ <
>> [email protected]>
>> *Verzonden:* vrijdag 11 april 2025 07:44
>>
>> *Aan:* jallib <[email protected]>
>> *Onderwerp:* Re: [jallib] hcsr04 3x
>> Hi Hans,
>>
>> Attached the version using the HC-SR04. Your original version gave 
>> compiler warnings but I kept those. They are not releated to this change.
>>
>> Give it a try to see how it works. The distance is measured in mm.
>>
>> Kind regards,
>>
>> Rob
>>
>> ------------------------------
>> *Van:* [email protected] <[email protected]> namens Hans van 
>> Veldhuizen <[email protected]>
>> *Verzonden:* donderdag 10 april 2025 22:33
>> *Aan:* jallib <[email protected]>
>> *Onderwerp:* Re: [jallib] hcsr04 3x 
>>  
>> Hi Rob, 
>> Here it is .
>> regards
>> Hans
>>
>> Op donderdag 10 april 2025 om 21:48:01 UTC+2 schreef Rob CJ:
>>
>> Hi Hans,
>>
>> You can send me your original file and I will see if I can change it for 
>> the HC-SR04.
>>
>> Kind regards,
>>
>> Rob
>>
>> ------------------------------
>> *Van:* [email protected] <[email protected]> namens Hans van 
>> Veldhuizen <[email protected]>
>> *Verzonden:* donderdag 10 april 2025 20:56
>> *Aan:* jallib <[email protected]>
>>
>> *Onderwerp:* Re: [jallib] hcsr04 3x
>> Rob,
>> When you get older it's not just the legs that get more difficult, the 
>> eyes that don't notice all the details anymore, but also more lumps appear 
>> in the gray stuff from above.
>> greetings Hans
>>
>> Op donderdag 10 april 2025 om 19:06:34 UTC+2 schreef vsurducan:
>>
>> Rob, Peter, a vacuum cleaner does not tells you if you have dust or not 
>> under your bed. The cat mustache, it does.
>>
>> On Thu, Apr 10, 2025 at 7:46 PM Rob CJ <[email protected]> wrote:
>>
>> Thanks Peter,
>>
>> I also have a Robot Vacuum Cleaner but it does not work with Ultrasonic 
>> Distance Sensors.
>>
>> I will also make a video about this project for more awareness (I hope).
>>
>> Kind regards,
>>
>> Rob
>>
>> ------------------------------
>> *Van:* [email protected] <[email protected]> namens zet.weeh 
>> <[email protected]>
>> *Verzonden:* maandag 7 april 2025 16:10
>> *Aan:* [email protected] <[email protected]>
>> *Onderwerp:* RE: [jallib] hcsr04 3x 
>>  
>>
>> Hi Rob
>>
>> Fantastic that car.
>>
>> I have not such a car and no cats but a vacuum cleaner. 
>>
>> Peter
>>
>>  
>>
>> *Van:* [email protected] [mailto:[email protected]] *Namens *
>> vsurducan
>> *Verzonden:* maandag 7 april 2025 14:20
>> *Aan:* [email protected]
>> *Onderwerp:* Re: [jallib] hcsr04 3x
>>
>>  
>>
>> Hans, I have two cats for that purpose. More convenient.😏
>>
>>  
>>
>> On Sat, Apr 5, 2025, 20:28 Hans van Veldhuizen <[email protected]> 
>> wrote:
>>
>> [image: 20250209_205634[1].jpg]
>>
>> Op zaterdag 5 april 2025 om 19:19:18 UTC+2 schreef Hans van Veldhuizen:
>>
>> Hi Rob,
>> That looks impressive. The one I made has a camera on board so I can look 
>> under the furniture to see if there is dust. The speed is therefore much 
>> lower and I could do everything with one 16F648a. I did use a ready-made 
>> motor driver set.
>> This is of course much more professional. Very good.
>> greetings Hans
>>
>> Op zaterdag 5 april 2025 om 19:12:36 UTC+2 schreef Rob CJ:
>>
>> Hi Vasile,
>>
>>  
>>
>> I remember that car. I had it as a toy. It worked completely mechanical. 
>> When it reached the end of the table it turned.
>>
>>  
>>
>> Could also buld it in this car 🙂.
>>
>>  
>>
>> Kind regards,
>>
>>  
>>
>> Rob
>>
>>  
>> ------------------------------
>>
>> *Van:* [email protected] <[email protected]> namens 
>> vsurducan <[email protected]>
>> *Verzonden:* zaterdag 5 april 2025 18:34
>> *Aan:* [email protected] <[email protected]>
>> *Onderwerp:* Re: [jallib] hcsr04 3x 
>>
>>  
>>
>> 👍👍
>>
>> Hi Rob, that's reminds me a  car which does not fall from the table where 
>> ever it goes. It had no electronics whatsoever except a bistable relay and 
>> two front and two rear contacts. Much more elaborated is yours... Great.
>>
>>  
>>
>> On Sat, Apr 5, 2025 at 6:30 PM [email protected] <[email protected]> 
>> wrote:
>>
>> Hi Hans,
>>
>>  
>>
>> I made a self driving Robot Wagon, just for fun, using three HC-SR04 
>> modules. I am using the JAL HC-SR04 library for measuring the distance but 
>> since the library is made to support only one module, I am using an Analog 
>> Multiplexer IC (74HC4052) to multiplex the three sensors.
>>
>>  
>>
>> For a video, see: https://youtu.be/kwYxd5GjtCw
>>
>>  
>>
>> I also posted the project on Instructables: 
>> https://www.instructables.com/Self-Driving-Robot-Wagon/
>>
>>  
>>
>> Kind regard,
>>
>>
>> Rob
>>
>>  
>>
>>  
>>
>> Op zondag 9 februari 2025 om 16:35:23 UTC schreef [email protected]:
>>
>> Hi Hans,
>>
>>  
>>
>> I did not make something like this but if you use the JAL library for the 
>> HC-SR04 you need to mutiplex the output of the device and connect the 
>> multiplexed signal to the interrupt pin of the PIC.
>>
>>  
>>
>> Next to that you need also need to multiplex the trigger signal that goes 
>> to each HC-SR04 module.
>>
>>  
>>
>> Kind regards,
>>
>>
>> Rob
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>> ------------------------------
>>
>> *Van:* [email protected] <[email protected]> namens Hans van 
>> Veldhuizen <[email protected]>
>> *Verzonden:* zondag 9 februari 2025 17:04
>> *Aan:* jallib <[email protected]>
>> *Onderwerp:* [jallib] hcsr04 3x 
>>
>>  
>>
>> Hello, I have tried the hc sr04 and now have something in hand that needs 
>> three such sensors at the same time. Has anyone made something like this 
>> before?
>> greetings
>> Hans 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/fe0e62b2-1bbb-43db-a9d8-50e84a814178n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/fe0e62b2-1bbb-43db-a9d8-50e84a814178n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/adec607b-948f-468f-8b6e-6acae5ead087n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/adec607b-948f-468f-8b6e-6acae5ead087n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/CAM%2Bj4quSimUY6U42QnHduBiyPXW4qqDWzZCQ6QtwNEyrOGenmA%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jallib/CAM%2Bj4quSimUY6U42QnHduBiyPXW4qqDWzZCQ6QtwNEyrOGenmA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/69dc0508-d457-40ac-ac46-f786ed49b602n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/69dc0508-d457-40ac-ac46-f786ed49b602n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/CAM%2Bj4qtKMLzerDA6udYugmB%2BcM9fkk%3DS%3DCfdvNX1NfJjm3Y31Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jallib/CAM%2Bj4qtKMLzerDA6udYugmB%2BcM9fkk%3DS%3DCfdvNX1NfJjm3Y31Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/000001dba7c6%24c03cb9d0%2440b62d70%24%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/jallib/000001dba7c6%24c03cb9d0%2440b62d70%24%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/AM7PR02MB6098F0EA8DE8B215E7C4A206E6B52%40AM7PR02MB6098.eurprd02.prod.outlook.com
>>  
>> <https://groups.google.com/d/msgid/jallib/AM7PR02MB6098F0EA8DE8B215E7C4A206E6B52%40AM7PR02MB6098.eurprd02.prod.outlook.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/0f84e016-5168-4d9b-93a0-904833768a65n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/0f84e016-5168-4d9b-93a0-904833768a65n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/7dc4af05-acb3-486c-8b64-8afa768f4b84n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/7dc4af05-acb3-486c-8b64-8afa768f4b84n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/AM7PR02MB60986C3D812D8E653889EF9CE6B62%40AM7PR02MB6098.eurprd02.prod.outlook.com
>>  
>> <https://groups.google.com/d/msgid/jallib/AM7PR02MB60986C3D812D8E653889EF9CE6B62%40AM7PR02MB6098.eurprd02.prod.outlook.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jallib/b3ba8314-4bad-43ed-ac15-eb68214e23een%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/b3ba8314-4bad-43ed-ac15-eb68214e23een%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/0f281291-33f6-418e-93af-112a239d1686n%40googlegroups.com.

Reply via email to