Created
January 28, 2011 15:12
-
-
Save laclefyoshi/800363 to your computer and use it in GitHub Desktop.
Arduino Metro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Metro.h> | |
#define LedPin1 10 | |
#define LedPin2 9 | |
Metro ledMetro1 = Metro(1000); | |
Metro ledMetro2 = Metro(2000); | |
void setup() { | |
pinMode(LedPin1, OUTPUT); | |
pinMode(LedPin2, OUTPUT); | |
} | |
void loop() { | |
if (ledMetro1.check() == 1) { | |
digitalWrite(LedPin1, !digitalRead(LedPin1)); | |
} | |
if (ledMetro2.check() == 1) { | |
digitalWrite(LedPin2, !digitalRead(LedPin2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment