I’m trying to use an ATtiny85 as a timer using an OLED screen and I’m getting an error on both timers like:
C:\Users\Michael\AppData\Local\arduino\sketches\31451F490CE4F6C6E5EA5B61DD97CD4D\core\Tone.cpp.o (symbol from plugin): In function _noTone':
(.text+0x0): multiple definition of __vector_4'
C:\Users\Michael\AppData\Local\arduino\sketches\31451F490CE4F6C6E5EA5B61DD97CD4D\sketch\Timer_test.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
I think this is saying the Interrupt service routine is already in use?
How do I find out what library is using the timers? Or have I missed the point somewhere?
I tried right clicking on the ‘TIM1_OVF_vect’ and clicking go to definition but I don’t really know what I’m doing at this point, I’m new to embedded programming.
I’m using an Arduino uno to program the ATtiny.
The PinChangeInterrupt library is for a different part of the project, there will be a button and rotary encoder
Please feel free to comment on any other aspects of my code that could be better.
The error told you where it was already defined. And it's not a library, it's in the core you're using. It even told you which file, and which function.
And you're already using register level programming and interrupts? Curious.
I want to display the elapsed time in seconds, minutes, hours and days
The timer1 overflow ISR increments a counter, and the main loop looks at that and calculates how many seconds have passed. when 60 seconds has passed it will increment the minute variable, then same of for hours and days.
yess, I got that far but wasn’t sure what that meant and whether I could use it or not. I can’t tell when the core is using it for? It just looks like a definition for the macro?
weird. I still get the error. It might be because I’m using the ATtiny as a board, instead of the arduino uno? I’m using DIY ATtiny → ATtiny 85 in the board manager.
It's in the core file Tone.cpp, in the function _noTone. It couldn't be clearer.
I have no idea what core you're using (because you haven't said) so I can't pull up the file itself to show it to you. You'll have to look on your own.
aah this is only half the project. I’ll be using a button and rotary encoder which needs that library, so I needed to make sure that wasn’t using the timer either.