added missing lib

This commit is contained in:
Patrick Valk
2016-11-18 10:03:16 +01:00
parent 9f9f6dd6c1
commit 175902e2b5
12 changed files with 329 additions and 0 deletions
@@ -0,0 +1,30 @@
/*
This code will blink an LED attached to pin 13 on and off.
It will stay on for 0.25 seconds.
It will stay off for 1 second.
*/
#include <Metro.h> //Include Metro library
#define LED 13 // Define the led's pin
//Create a variable to hold theled's current state
int state = HIGH;
// Instanciate a metro object and set the interval to 250 milliseconds (0.25 seconds).
Metro ledMetro = Metro(250);
void setup()
{
pinMode(LED,OUTPUT);
digitalWrite(LED,state);
}
void loop()
{
if (ledMetro.check() == 1) { // check if the metro has passed its interval .
if (state==HIGH) state=LOW;
else state=HIGH;
digitalWrite(LED,state);
}
}