Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created January 28, 2011 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laclefyoshi/800363 to your computer and use it in GitHub Desktop.
Save laclefyoshi/800363 to your computer and use it in GitHub Desktop.
Arduino Metro
#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