HC-SR04 not working with ""Pic"" Anymore

For general Flowcode discussion that does not belong in the other sections.
medelec35
Matrix Staff
Posts: 2086
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by medelec35 »

daddytims_tims wrote:
Thu Aug 22, 2024 4:34 pm
Hi Martin

I just tried. It still doesn't work. I copy the file to the folder updated it, try compiled but fail.
I restarted the win 11/ project It still fails.

I am using v10
That still looks like the old version and not the latest?
Can you go to Library updates and select Show up-to-date files and what version does it show for HC_SR04_Ultrasonic.fcpx?
Martin

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by medelec35 »

jgu1 wrote:
Thu Aug 22, 2024 4:42 pm
I can compile now but the distance show random numbers.
That could be down to the Timer Settings property,
What about starting at say 1:1 for both, then just increase if still not working?
1:1 is not recommended for really fast clock speeds e.g. esp32
Martin

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Flowcode v10 Re: HC-SR04 not working with ""Pic"" Anymore

Post by daddytims_tims »

Updates.png
Updates.png (146.03 KiB) Viewed 5748 times

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by medelec35 »

Hi.
That tells me I was correct.
When you add the fixed component to

Code: Select all

%ProgramData%\MatrixTSL\FlowcodeV10\Components
What you should see is:
unoffical updates.png
unoffical updates.png (4.21 KiB) Viewed 5730 times
Since it's not an official library update.
Did you restart Flowcode or reload your project.
Don't click on the Download after adding the unofficial component update.
Martin

daddytims_tims
Posts: 74
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 118 times
Been thanked: 13 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by daddytims_tims »

Hi

Martin, I had click update during earlier part.

Since your last message, I follow on to that Now I got it to work.

Thanks, Alot :D

I will update you

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by jgu1 »

With arduino.

No matter what I do when I use timer interrupt, the value is fluactuating. But if I "disable " timerinterrupt it work fine.

Thank´s Martin glad it working again.

Jorgen

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by medelec35 »

Hi Jorgen.
I will look in to why its fluctuating with Arduino tomorrow.
Martin

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by jgu1 »

Thank you, very much. ;)

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by medelec35 »

hi Jorgen.
Sorry it's the other way around.
With the Uno can you try with Timer 0 set to:
Prescaler 1:1024
Postscaler 1:16
Martin

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: HC-SR04 not working with ""Pic"" Anymore

Post by jgu1 »

Hi again Martin!

Yes, now it is stable, but the distance is max. 92 Cm.

br Jorgen
Attachments
SR04_WaterProofArduino.fcfx
(11.58 KiB) Downloaded 239 times

Post Reply