|
std::chrono::microseconds | remaining_time () const |
| Return time remaining until callback.
|
|
template<typename F > |
MBED_FORCEINLINE void | attach (F &&func, float t) |
| Attach a function to be called by the Ticker, specifying the interval in seconds.
|
|
void | attach (Callback< void()> func, std::chrono::microseconds t) |
| Attach a function to be called by the Ticker, specifying the interval in microseconds.
|
|
void | attach_us (Callback< void()> func, us_timestamp_t t) |
| Attach a function to be called by the Ticker, specifying the interval in microseconds.
|
|
void | detach () |
| Detach the function.
|
|
A Timeout is used to call a function at a point in the future.
You can use as many separate Timeout objects as you require.
- Note
- Synchronization level: Interrupt safe
Example:
#include "mbed.h"
int on = 1;
void attimeout() {
on = 0;
}
int main() {
timeout.attach(&attimeout, 5);
while(on) {
led = !led;
ThisThread::sleep_for(200);
}
}
A digital output, used for setting the state of a pin.
Definition at line 60 of file Timeout.h.