Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created January 28, 2011 15:07
Show Gist options
  • Save laclefyoshi/800358 to your computer and use it in GitHub Desktop.
Save laclefyoshi/800358 to your computer and use it in GitHub Desktop.
Arduino FlexiTimer2
#include <FlexiTimer2.h>
#define LedPin1 10
#define LedPin2 9
void blink1() {
digitalWrite(LedPin1, !digitalRead(LedPin1));
}
void blink2() {
digitalWrite(LedPin2, !digitalRead(LedPin2));
}
void setup() {
pinMode(LedPin1, OUTPUT);
pinMode(LedPin2, OUTPUT);
FlexiTimer2::set(1000, blink1); // not work!
// or rather, above code is overwrited by following statement.
FlexiTimer2::set(2000, blink2);
FlexiTimer2::start();
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment