Comments (3)
There's no way to know the difference between "still waiting" and no ping
result. If there's no ping result, it's still waiting. All that we know is
that EITHER it's out of range OR no ping result.
The current code already tracks "still waiting" when sonar.check_timer()
returns false. This needs to be polled anyway, so there's no saving and you
can't access ping_result directly as a result. It could be done to set
ping_result to zero if the ping times out. But, I feel that's wasted code as
all you know is that it's "all clear".
Basically, the only time you should be doing something with the ping_result
value is when check_timer() returns a true value. False values tell you that
it hasn't got a ping yet. This is designed to alert you when something is in
range, not inform you of the status of the ping. If you need to know the
status of the ping, you will need outside code as you're doing now.
Original comment by eckel.tim
on 15 Jul 2013 at 1:56
from arduino-new-ping.
[deleted comment]
from arduino-new-ping.
Please report this in a more appropriate place.
Original comment by eckel.tim
on 19 Sep 2013 at 6:58
- Changed state: Invalid
from arduino-new-ping.
Related Issues (13)
- Program copied and pasted, will not verify or upload. HOT 4
- Not compatible with tone ( ) function. HOT 2
- Can't tell difference between still waiting and ping timeout HOT 1
- object moving faster than ping leaves old reading HOT 1
- Missing one pin detection code causes erroneous trig output HOT 1
- ProblemMessure on cm HOT 6
- Ping readings vary wildly HOT 6
- ping_median seems to freeze a lot HOT 6
- New Ping got issues with tone(); HOT 2
- Doesn't work with Arduino Robot HOT 3
- Encompatible with adafruit motor shield HOT 1
- Incompatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-new-ping.