Skip to content

RunAt is a small library for the Arduino Platform to run a function at a given timestamp

License

Notifications You must be signed in to change notification settings

Ungedummt/RunAt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RunAt

RunAt is a small library for the Arduino Platform to run a function at a given timestamp. But it does'nt uses threads, instead it uses the main thread of the microcontroller to run. Therefore you need to call run_at_loop() in the loop of you're code. This function iterates over all scheduled functions and runs them if the timestamp is reached.

Example

#include <RunAt.h>

void print_1() {
  Serial.println("print 1");
}

void print_2() {
  Serial.println("print 2");
}

void print_3() {
  Serial.println("print 3");
}

void setup() {
  Serial.begin(115200);

  run_at_function_in_millisec(print_1, 1000);
  run_at_function_in_millisec(print_3, 3000);
  run_at_function_in_millisec(print_2, 2000);
}

void loop() {
  run_at_loop();
}

About

RunAt is a small library for the Arduino Platform to run a function at a given timestamp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published