Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real sensor delay #64

Closed
dragoblaztr opened this issue Oct 7, 2018 · 4 comments
Closed

Real sensor delay #64

dragoblaztr opened this issue Oct 7, 2018 · 4 comments

Comments

@dragoblaztr
Copy link

I'm looking at example 5, and I have a question about how do I get the real sensor delay instead a simulated one like in this example?

@arkhipenko
Copy link
Owner

arkhipenko commented Oct 7, 2018

In my experience, unless a sensor has a capability of sending you a pin interrupt, there is no other way, so what I usually do is wait a reasonable amount of time and then timeout.

For instance, the ultrasonic sensor changes from low to high when it starts measuring, and then from high to low when it's done, so there are falling/rising edges to anchor on.
However, there is a reasonable expectation of either a distance you are interested in, or a max range, after which you stop caring.
check this out:
Event-based ultrasonic distance measurement

Gyroscopes have a designated interrupt pin for data ready purposes.
Some Thermo sensors just take a predefined time (like a 100 Ms) for measurements.

What sensor are you working with?

@dragoblaztr
Copy link
Author

dragoblaztr commented Oct 8, 2018

I'm using MAX6675 thermpcouple, how can I configure that sketch to measure that sensor timeout, since I noticed than in that example is like this:

tSensor2.setInterval( random(1200) );

tSensor2.getInterval()

Thanks in advance

@arkhipenko
Copy link
Owner

Example 5 simulates the behaviour of an ultrasonic sensor, which is measuring the time of sound wave travel, which, depending on the distance, is variable. Hence use of random() in the example.

Thermocouple does not have a delay, and as far I was able to find out here:
datasheet uses serial interface to send the measurement back to sketch (page 5). So there is no delay.
You just use this library adafruit and read the value.

I am not even sure you need to use code from example 5. Example 5 is a case of triggering events based on a number of sensors with unpredictable completion time. Does not seem like this is the case in your example.

@dragoblaztr
Copy link
Author

Ok, I'll take it on mind, thanks for the advice.

Issue closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants