Error in SoftwareSerial lib while compiling

Hi, folks.

Whenever I try to compile my project (which uses SoftwareSerial) I get a lot of errors messages. I don't know why it happens. I had used SoftwareSerial sometimes ago, but it is the first time that I'm facing this problem.

I'm trying to remotely (via bluetooth) control the arduino robot (this one: https://www.arduino.cc/en/Main/Robot). I already have selected the right board (Arduino Robot Control).

The messages can be seen in this link: Dropbox - Error - Simplify your life

Any ideas what can be happening?
Thank you in advance :slight_smile:

Here is the code:

#include <ArduinoRobot.h>
#include <SoftwareSerial.h>

#define rxPin TK6
#define txPin TK4

SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);

void setup() {
Robot.begin();
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
Serial.begin(9600);
mySerial.begin(9600);
}

void loop() {
if(mySerial.available()){
char c = mySerial.read();
Serial.println(c);
}
delay(100);
}

And here are the messages:


/opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
/opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:319:36: error: 'digitalPinToPCICR' was not declared in this scope
if (digitalPinToPCICR(_receivePin)) {

^
In file included from /opt/arduino/hardware/tools/avr/avr/include/avr/io.h:99:0,
from /opt/arduino/hardware/tools/avr/avr/include/avr/interrupt.h:38,
from /opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:41:
/opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:360:76: error: 'digitalPinToPCICRbit' was not declared in this scope
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));

^
/opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:363:51: error: 'digitalPinToPCMSK' was not declared in this scope
_pcint_maskreg = digitalPinToPCMSK(_receivePin);

^
In file included from /opt/arduino/hardware/tools/avr/avr/include/avr/io.h:99:0,
from /opt/arduino/hardware/tools/avr/avr/include/avr/interrupt.h:38,
from /opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:41:
/opt/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:364:60: error: 'digitalPinToPCMSKbit' was not declared in this scope
_pcint_maskvalue = _BV(digitalPinToPCMSKbit(_receivePin));

^
exit status 1
Error compiling.

That error was discussed here about a month ago, in relation to that board. I seem to remember it is a problem with the Arduino board definition and we had to copy-paste from another board. Keep digging in the forums. Your answer is there.

It may have been fixed in the latest IDE. Download and reinstall Arduino again.

Also that Robot board uses the same chip as the Leonardo and Micro. It only has a couple of pins usable for software Rx. Check the library page for this limitation.