Add Library

This commit is contained in:
Siwat Sirichai 2019-08-09 09:01:56 +07:00
parent e365b9dbd9
commit 3c47103b39
318 changed files with 56465 additions and 0 deletions

View file

@ -0,0 +1,35 @@
#include <Thread.h>
int ledPin = 13;
//My simple Thread
Thread myThread = Thread();
// callback for myThread
void niceCallback(){
static bool ledStatus = false;
ledStatus = !ledStatus;
digitalWrite(ledPin, ledStatus);
Serial.print("COOL! I'm running on: ");
Serial.println(millis());
}
void setup(){
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
myThread.onRun(niceCallback);
myThread.setInterval(500);
}
void loop(){
// checks if thread should run
if(myThread.shouldRun())
myThread.run();
// Other code...
int x = 0;
x = 1 + 2;
}