Hello to all, I'm trying to use interrupt on ATtiny85 and the softwareserial. But when I compile i get this error
libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_2'
sketch\sketch_oct30a.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Più di una libreria trovata per "SoftwareSerial.h"
Usata: C:\Program
exit status 1
Errore durante la compilazione per la scheda ATtiny25/45/85.
I've tried to change the ISR condition from ISR(PCINT0_vect) to ISR(INT0_vect), but nothing happened now it's compile but don't do what is wrote in the ISR function.
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <SoftwareSerial.h>
#define RX_PIN 0
#define TX_PIN 1
SoftwareSerial mySerial(RX_PIN, TX_PIN);
int countR=0;
int l00p=0;
void setup() {
mySerial.begin(9600);
pinMode(2,INPUT_PULLUP);
pinMode(3,OUTPUT);
cli();
GIMSK = (1 << INT0); //Enable Pin Change Interrupts
PCMSK = (1 << PCINT0);
sei();
}
void loop() {
mySerial.print("Stato pulsante ");
mySerial.println(!digitalRead(0));
mySerial.println(countR);
if(digitalRead(0)==0){
mySerial.println("qui ci dovrebbe essere l'interrupt");
}
delay(500);
}
ISR(INT0_vect){
countR++;
digitalWrite(3,HIGH);
mySerial.println("prova");
}
This is the code that I used for test. Some advice? Or Help are appreciated