Author Topic: Using MsTimer2 Arduino-Library  (Read 8410 times)

0 Members and 1 Guest are viewing this topic.


Using MsTimer2 Arduino-Library
« on: January 17, 2012, 03:13:46 PM »

i tied to use the Arduino library "MsTimer2" on a Wiring S, but i was not able to compile the example code.

Code: [Select]
#include <MsTimer2.h>

// Switch on LED on pin 13 each second

void flash() {
  static boolean output = HIGH;
  digitalWrite(13, output);
  output = !output;

void setup() {
  pinMode(13, OUTPUT);

  MsTimer2::set(500, flash); // 500ms period

void loop() {

the error is:

core.a(WHardwareTimer.cpp.o): In function `__vector_11':
/Applications/ multiple definition of `__vector_11'
MsTimer2/MsTimer2.cpp.o:/Applications/ first defined here

What can i do, to get it working? is Timer2 reserved for something ?

Thank you
« Last Edit: January 17, 2012, 03:17:51 PM by olivere »


Re: Using MsTimer2 Arduino-Library
« Reply #1 on: January 23, 2012, 08:20:16 AM »
I've got it working:

i've just uncommented the function at:


and it works fine ^^


Re: Using MsTimer2 Arduino-Library
« Reply #2 on: January 26, 2012, 04:15:05 PM »
great, please also check the libraries tutorial posted by Alexander: