Software Serial and Change interrupt problem.

I need help in using software serial library with change to interrupt pin as well. I tried newSWserial library as well but could not solve them.

I get this error each time.

libraries/SoftwareSerial/SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()': (.text+0x0): multiple definition of _vector_3'
sketch/Encoder_Ros_Both
.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/SoftwareSerial/SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()': (.text+0x0): multiple definition of _vector_5'
sketch/Encoder_Ros_Both
.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

I understood that this is because I am using ISR(PCINTx_vect) in my code and the same is declared in the lbraries i am using. How to solve the problem i just need 2 more interrupt pin and 1 interrupt only for rx.

It might be easier for us to analyse the exact cause of the issue if you post the code. If you only have one ISR defined (yourself), I doubt the compiler will complain about two interrupt vectors.

Are you using the pcint library (or whatever it's called)?

Did you see the smileys in your post? If you post your errors (and code) using code tags, that will not happen. Read point 7 in how to use this forum

libraries/SoftwareSerial/SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_3'
sketch/Encoder_Ros_Both_.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries/SoftwareSerial/SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_5'
sketch/Encoder_Ros_Both_.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

First, I would not recommend SoftwareSerial. It is very inefficient, because it disables interrupts for long periods of time. This can interfere with other parts of your sketch or with other libraries.

It would be much, much better to use AltSoftSerial (works on two specific pins, 8 & 9 on an UNO). It is very efficient and can transmit and receive at the same time, unlike SoftwareSerial. This will also avoid the ISR conflict.

If you can’t use those pins (are you sure?), use my NeoSWSerial on any two pins. It has an option to disable the PCI ISRs so you can have your own PCI ISRs. Simply uncomment this define in NeoSWSerial.h:

  //#define NEOSWSERIAL_EXTERNAL_PCINT // uncomment to use your own PCINT ISRs

This will require you to setup the ISR in your sketch and call the NeoSWSerial::rxISR method:

#include <NeoSWSerial.h>
#define RX_PIN 7
#define TX_PIN 8

NeoSWSerial someDevice( RX_PIN, TX_PIN ); //   <--  Pick a good a name!

ISR(PCINT0_vect) // or whatever
{
  NeoSWSerial::rxISR( *portInputRegister( digitalPinToPort( RX_PIN ) ) );
  // or, if you know the port register:    NeoSWSerial::rxISR( PIND );
}

void setup()
{
  Serial.begin( 9600 );

  ... enable CHANGE PCI interrupt on RX_PIN here...

  someDevice.begin( 9600 );
}

void loop()
{
  if (someDevice.available()) { // check for chars
     ...

AltSoftSerial and NeoSWSerial are available from the IDE Library Manager, under the menu Sketch → Include Library → Manage Libraries.

Cheers,
/dev