Problem with 'multiple vector 13'

Hi,

For my integrated project i make an automated rollerblind.
I use the files ‘TimerOne.h’ , ‘avr.io.h’ and ‘avr/interrupt.h’.
However, when i try to verify my program i recieve the error ‘multiple definition of `__vector_13’.
First i looked up on the internet but i didn’t found my answer.
The second option was to ask my mentor and my friends. Unfortunately, they didn’t understand either.
Can someone tell me what this error means and make some alternatives or suggestions how to fix this? Also can you give me some tips and advices?

Here is my following code. (The full code)
I suggest if you want to help me, that you open the file.

Thanks for your time!

// Definition of Timer 1
#include <TimerOne.h>

// Definition of interrupt names
#include <avr/io.h>

// ISR interrupt service routine
#include <avr/interrupt.h>


// RelayUp connected to digital pin 12
int RelayPinUp = 4;

// RelayDown connected to digital pin 13
int RelayPinDown = 5;

// This is the INT0 Pin of the ATMega8
int sensePinUp = 2;

// This is the INT1 Pin of the ATMega8
int senseHallsensor = 3;

// Initialize Timer

double Timer = 500000; // go for 3 minutes (7700000)
volatile boolean StatusUp = false;
boolean Initialization = true;


// We need to declare the data exchange
// variable to be volatile - the value is
// read from memory.

volatile boolean Boole0Down = true;
volatile boolean Boole1Up = true;
volatile boolean PreviousStatusBoole1Up = true;
volatile boolean Magnet = false;

//Variables for Hallsensor
volatile int MaxCount = 0;
volatile int CurrentCount = 0;

  
// Install the interrupt routine INT0

void ButtonPress()
{
  Serial.println("Button is pushed");
  Serial.println(Boole1Up);

  //check while one of the boolean is true(if one of the buttons is pressed)

  // if boolean 'PreviousStatusBoole1Up is false

  if(PreviousStatusBoole1Up)
  {
      //if Boole0Down is true and button is pressed, then put 'Boole0Down' on false and the roller blind stop going down

      if(Boole0Down)
      {
        Boole0Down = false;
        Boole1Up = true;
      }

      //if Boole0Down is false and button is pressed, then Boole1Up and PreviousStatusBoole1Up goes true and the roller blind goes up

      else
      {
        Boole1Up = true;
        Boole0Down = true;
        PreviousStatusBoole1Up = true;
      }  
  }

  // if boolean 'PreviousStatusBoole1Up is true

  else
  {
    //if Boole1Up is true and button is pressed, then Boole1Up goes false and the roller blind stop going up
    if(Boole1Up)
    {   
        Boole1Up = false;
        Boole0Down = true;
    }

    //if Boole1Up is false and button is pressed, then Boole0Down and PreviousStatusBoole1Up goes true and the roller blind goes down

    else
    {
        Boole0Down = true;
        Boole1Up = true;
        PreviousStatusBoole1Up = false;
    }
  }

  EIFR|= ( 1 << INTF0);
}

// Install the interrupt routine INT1

void HallSensor()
{
// initialization

  if(Initialization)
  {
    Serial.println("MaxCount = "+MaxCount);
    if(Magnet)
    {
      MaxCount = MaxCount+1;
    } 
    Initialization = false; 
  }
  else
  {
    Serial.println("CurrentCount = "+CurrentCount);

    // rollerblind goes up
    if(Magnet && CurrentCount != MaxCount)
    {
      CurrentCount = CurrentCount+1;
    }

    // rollerblind goes down

    Serial.println("CurrentCount = "+CurrentCount);
    if(Magnet && CurrentCount != MaxCount)
    {
      CurrentCount = CurrentCount-1;
    }
   }
}

void setup() {

  Serial.begin(9600);
  Serial.println("Initializing handler");
  delay(2000);

  // sets the digital pin as output
  pinMode(RelayPinUp, OUTPUT);
  pinMode(RelayPinDown, OUTPUT);

  // read from the sense pin
  pinMode(sensePinUp, INPUT);
  pinMode(senseHallsensor, INPUT);

  Serial.println("Processing initialization");

 // initialize timer1

  noInterrupts();           // disable all interrupts
  TCCR1A = 0;
  TCCR1B = 0;

  TCNT1 = 57344;            // preload timer 65536-16MHz/1024/2Hz
  TCCR1B |= (1 << CS12);    // 1024 prescaler
  TCCR1B |= (1 << CS10);    // 
  TIMSK1 |= (1 << TOIE1);   // enable timer overflow interrupt
  attachInterrupt(0, ButtonPress, RISING);
  attachInterrupt(1, HallSensor, RISING);
  interrupts();             // enable all interrupts

}
//-----------------------------------------------
// interrupt service routine that wraps a user defined function
// supplied by attachInterrupt

ISR(TIMER1_OVF_vect)
{
  while(Timer != 0 || StatusUp == false)
  {
    if(Timer != 0)
    {
      digitalWrite(RelayPinUp, LOW);

      digitalWrite(RelayPinDown, HIGH);
      Timer--;
      Serial.println(Timer);
    }
    else
    {
      digitalWrite(RelayPinUp, HIGH);
      StatusUp = true;
      delay(500000);
      MaxCount = 0;
      CurrentCount = 0;
      Serial.println("Rolgordijn stopt");
    }
  }
  Timer =500000; // 3 minutes (7700000)
  while(Timer != 0 || StatusUp == true)
  {
    if(Timer != 0)
    {
      digitalWrite(RelayPinDown, LOW);
      digitalWrite(RelayPinUp, HIGH);
      Timer--;
      Serial.println(Timer);
    }
    else
    {
      digitalWrite(RelayPinUp, HIGH);
      digitalWrite(RelayPinDown, HIGH);
      Initialization = false;
    }
  }
  Serial.println("Rollerblind stops with moving.");
}

//
void loop() 
{
  
    digitalWrite(RelayPinUp, Boole0Down);
    digitalWrite(RelayPinDown, Boole1Up);
}

rolgordijnK6-070517.ino (4.55 KB)

If you use the TimerOne library, why do you still have an ISR for timer1's overflow? Maybe have a look at the TimerOne interrupt example?

By the way

1) I removed the include of TimerOne and your code happily compiles. So why the use of TimerOne. 2) The error is actually very clear; there are multiple places where ISR(TIMER1_OVF_vect) is defined. You can also look in the datasheet what the vector is

Vector No. Program Address Source Interrupt Definition
1 0x000 RESET External Pin, Power-on Reset, Brown-out Reset and Watchdog System Reset
2 0x001 INT0 External Interrupt Request 0
3 0x002 INT1 External Interrupt Request 1
4 0x003 PCINT0 Pin Change Interrupt Request 0
5 0x004 PCINT1 Pin Change Interrupt Request 1
6 0x005 PCINT2 Pin Change Interrupt Request 2
7 0x006 WDT Watchdog Time-out Interrupt
8 0x007 TIMER2 COMPA Timer/Counter2 Compare Match A
9 0x008 TIMER2 COMPB Timer/Counter2 Compare Match B
10 0x009 TIMER2 OVF Timer/Counter2 Overflow
11 0x00A TIMER1 CAPT Timer/Counter1 Capture Event
12 0x00B TIMER1 COMPA Timer/Counter1 Compare Match A
13 0x00C TIMER1 COMPB Timer/Coutner1 Compare Match B
[b]14 0x00D TIMER1 OVF Timer/Counter1 Overflow[/b]
...
...

Look at the numbers in the left column, subtract one and you have your vector 13 (0x00D also equals 13).