Comments (4)
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.
from taskscheduler.
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?
from taskscheduler.
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
from taskscheduler.
Ok, I'll take it on mind, thanks for the advice.
Issue closed
from taskscheduler.
Related Issues (20)
- V3.7.0 kills ESP32 WiFi HOT 2
- Scheduler not executing on ESP8266 HOT 3
- fluently change task interval, within another tasks periodicity HOT 5
- Least possible scheduling time HOT 9
- Set the core where a task execute HOT 2
- Declare task to run with delay HOT 2
- Keep trying if 'onEnable' fails HOT 8
- Method to get the name of the Callback registered in the Task HOT 7
- Async Webserver problem HOT 10
- esp32-c3 freezing after for tasks over 5800ms with _TASK_SLEEP_ON_IDLE_RUN. Regular esp32 works fine. HOT 2
- Library Suggestion HOT 1
- TaskScheduler Task Callbacks With OO in Callback HOT 2
- ODR Violation With Multiple Uses of TaskScheduler Throughout a Project HOT 1
- The banner link in README.md isn't working. HOT 1
- Compilation error when try to warp TaskScheduler's Task and execute() in a class HOT 2
- `_TASK_STD_FUNCTION` should be for everyone.
- enableDelayed() calls Callback immediately HOT 2
- C++ compiler warning: compound assignment with 'volatile'-qualified left operand is deprecated HOT 14
- "multiple definition of" linker errors if TaskScheduler.h included in multiple header/source files HOT 4
- Task.isEnabled() crashes ESP8266 when run in interrupt HOT 16
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 taskscheduler.