Hi Simon,
After my comment I found that I can use
if(srf.read()==7) but there is a problem with this. I use
srf05 in my robot to stop in 7 cm of a box. when my robot moves
very slow it stops in 7 cm of the box but when it moves a little faster
it does not stop in 7 cm of the box.
Do you think the problem is in the library
or in my code?
Hi Simon,
After my comment I found that I can use
if(srf.read()==7) but there is a problem with this. I use
srf05 in my robot to stop in 7 cm of a box. when my robot moves
very slow it stops in 7 cm of the box but when it moves a little faster
it does not stop in 7 cm of the box.
Do you think the problem is in the library
or in my code?
Hi i would say your code.
Because if your robot goes to fast in relation to the sample time you use for your range finder you will likely miss the 7 cm mark.
I would suggest you try "if(srf.read()<=7)"
Hi i would say your code.
Because if your robot goes to fast in relation to the sample time you use for your range finder you will likely miss the 7 cm mark.
I would suggest you try "if(srf.read()<=7)"
Hi i would say your code.
Because if your robot goes to fast in relation to the sample time you use for your range finder you will likely miss the 7 cm mark.
I would suggest you try "if(srf.read()<=7)"
Hi when I use 0.1 for duty cycle of my H bridge it stops but when I use 0.2 for duty cycle it does not stop do you think the speed
is so much that SRF05 could not find the box?
Should I write my own code for SRF05
<<quote chris215>>
Hi i would say your code.
Because if your robot goes to fast in relation to the sample time you use for your range finder you will likely miss the 7 cm mark.
I would suggest you try "if(srf.read()<=7)"
<</quote>>
Hi when I use 0.1 for duty cycle of my H bridge it stops but when I use 0.2 for duty cycle it does not stop do you think the speed
is so much that SRF05 could not find the box?
Should I write my own code for SRF05
I find a mistake in library
It is about tigger puls
In the library it is 2us not 20us.
20us=0.00002,
2us=0.000002,
any way it does not solve my problem
I find a mistake in library
It is about tigger puls
In the library it is 2us not 20us.
20us=0.00002,
2us=0.000002,
any way it does not solve my problem
Hi, I am running HS-SR04 with the code above and it works fine but only if it is pointing to the flat surface like a wall, but if it is pointed to the desk full of stuff it stops responding and returns the last value repeatedly. After disconnecting GND or 5V and connecting it back sensor works again. Is the same thing happening with SRF05?
Hi, I am running HS-SR04 with the code above and it works fine but only if it is pointing to the flat surface like a wall, but if it is pointed to the desk full of stuff it stops responding and returns the last value repeatedly. After disconnecting GND or 5V and connecting it back sensor works again. Is the same thing happening with SRF05?
Please login to post comments.