Recent update of HCSR04

Any bugs you encounter with Flowcode should be discussed here.
ELECTRONICA67
Posts: 83
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: Recent update of HCSR04

Post by ELECTRONICA67 »

Hello Jorge,

I made the selection of the component, but it keeps sending 0 zero. :(

Enrique
Attachments
COMPnew.jpg
COMPnew.jpg (49.69 KiB) Viewed 230 times

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: Recent update of HCSR04

Post by ELECTRONICA67 »

config
Attachments
configu.jpg
configu.jpg (47 KiB) Viewed 230 times

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: Recent update of HCSR04

Post by jgu1 »

Hi Enrique!


Have you tryed to change the timer and the prescaler and postscaler?

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: Recent update of HCSR04

Post by ELECTRONICA67 »

Hi Jorgen, I will do tests and keep you informed.

Enrique
Thanks

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: Recent update of HCSR04

Post by ELECTRONICA67 »

Thanks Jorgen and Martin

work with timer1, 1:1, 1:1 with 16 bit timer; The reading is a little unstable, but it sends a reading very close to the real one. I think it is for INT readings 0-65535 and the sensor has a reading of 20-290 that exceeds the 8 bit timer 0-255. I had thought the setting was timer0 1:1 1:1 as the base selection. :D

Enrique
Thanks

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: Recent update of HCSR04

Post by jgu1 »

Ok, at least it begin to work. Play with the Prescaler too.
Martin managed to make it wery flexible.
The att. examble with 8bit Pic work very fine for me, change to your kind of sensor. And for Arduino. Have a look

Good luck :D

Jorgen
Attachments
HC-SR04_Distance_Sensor__Arduino_WORKING.fcfx
(13.16 KiB) Downloaded 10 times
HC-SR04_Distance_Pic16f876Working.fcfx
(12.24 KiB) Downloaded 9 times

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: Recent update of HCSR04

Post by ELECTRONICA67 »

Thanks Jorgen, I'm going to test these two examples on Arduino and PIC, I appreciate the help.

Enrique
Best Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Recent update of HCSR04

Post by medelec35 »

Thanks Jorgen

Hi Enrique,
If you are still having issues, then can you post your .fcfx file and I will see if I can spot what's going on
Martin

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: Recent update of HCSR04

Post by ELECTRONICA67 »

Thanks Martin, I'll let you know, I appreciate the help.

Enrique
Best Regards

Post Reply