I am having a problem compiling the code for my ATtiny85 circuit.
I am using the timer/counter0 in normal mode so that when it overflows it triggers the TIMER0_OVF_vect ISR. When I have that ISR in my code, it wont compile and gives this error:
wiring.c.o (symbol from plugin): In function `__vector_5':
(.text+0x0): multiple definition of `__vector_5'
sketch\Glove_heater_v1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board ATtiny25/45/85.
Maybe I just need to use a different name for the ISR?
My Code:
//Red LED on PB0
//Blue LED on PB1
//Pushbutton PB2
//Battery voltage divider PB3
//Mosfet control PB4
#include <avr/io.h>
#include <stdint.h>
#include <avr/interrupt.h>
volatile uint8_t checkVoltage = 0;
void setup() {
DDRB = 0b0010011; //set PB0,PB1,PB4 as output, PB2,PB3 as input
PORTB = 0b00000011; //set PB0,PB1 HIGH so LEDs are off, other pins LOW
//Setup TC0 for overflow interrupt trigger
TCCR0B |= 0b00000101; //clk/1024 prescaler
TIMSK |= 0b00000010; //set TOIE0 enable overflow interrupt
sei();
}
void loop() { //do nothing in this test code
}
ISR(TIMER0_OVF_vect){ //Timer/counter0 interrupt check voltage
checkVoltage = 1;
}
Any ideas are appreciated!