Hello Jorge,
I made the selection of the component, but it keeps sending 0 zero.
Enrique
Recent update of HCSR04
-
- Posts: 83
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
Re: Recent update of HCSR04
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.
Enrique
Thanks
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.
Enrique
Thanks
-
- Posts: 615
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 509 times
- Been thanked: 132 times
Re: Recent update of HCSR04
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
Jorgen
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
Jorgen
- Attachments
-
- HC-SR04_Distance_Sensor__Arduino_WORKING.fcfx
- (13.16 KiB) Downloaded 15 times
-
- HC-SR04_Distance_Pic16f876Working.fcfx
- (12.24 KiB) Downloaded 16 times
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
Re: Recent update of HCSR04
Thanks Jorgen, I'm going to test these two examples on Arduino and PIC, I appreciate the help.
Enrique
Best Regards
Enrique
Best Regards
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
Re: Recent update of HCSR04
Thanks Martin, I'll let you know, I appreciate the help.
Enrique
Best Regards
Enrique
Best Regards