Problem over here. In one sketch I am trying to use both <SoftwareSerial.h> and <PinChangeInt.h> libraries (link to the second library: click me). This results in nasty errors:
Arduino: 1.6.1 (Windows 7), Board: "Arduino Uno"
SoftwareSerial\SoftwareSerial.cpp.o: In function `__vector_3':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:227: multiple definition of `__vector_3'
ver3.3.cpp.o:C:\Program Files (x86)\Arduino\libraries\PinChangeInt-master/PinChangeInt.h:594: first defined here
SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_4'
ver3.3.cpp.o:C:\Program Files (x86)\Arduino/ver3.3.ino:243: first defined here
SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_5'
ver3.3.cpp.o:C:\Program Files (x86)\Arduino/ver3.3.ino:243: first defined here
collect2.exe: error: ld returned 1 exit status
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
The reason that I am using the second library is that I have already used both avaiable interrupt pins on Uno. Is there any way that I can bypass that errors?
If sending only, there is a version that doesn't use interrupts.
Where can this library be found?
I ran into the problem while trying to use SoftwareSerial with PCINT3 on an ATTiny85.
I tried ReceiveOnlySoftwareSerial but I get the same errors as with Software Serial:
libraries\ReceiveOnlySoftwareSerial\ReceiveOnlySoftwareSerial.cpp.o (symbol from plugin): In function `ReceiveOnlySoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_2'
sketch\chest1_1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
sketch\chest1_1.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.
Thanks it compiles, but I don't see output on serial monitor. Does it support "print" and "println" commands?
EDIT: Sorry I see from your example usage posts that it does.
I replaced the include, declaration and begin statements with SendOnlySoftwareSerial instead of SoftwareSerial. I have timers 0 and 1 set at 'abnormal' conditions to use the interrupts (PLL clock used for timer1); is the send only library compatible with this condition? I am using PCINT3 and both timers in the code already.
perigalacticon:
Thanks it compiles, but I don't see output on serial monitor.
Depending on your wiring, I wouldn't expect you to. The serial monitor normally shows what is being sent on hardware serial. You could feed the serial line into something else (eg. another Arduino, or an oscilloscope) to verify it is working.
I have previously read serial data from the ATTiny85 using the standard SoftwareSerial library, transmitting to an UNO that runs a sketch that reads data from the Tiny85 and sends it to the serial monitor.
Should the ReceiveOnly library work if I am running timers0&1 at non-standard settings, along with PCINT3?
On the ATTiny chips that don't have hardware serial, when using my ATTiny core ( GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 ), you can get access different software serial implementation named Serial (like the hardware serial normally is) - this one uses the analog comparator pins (AIN0, AIN1) and interrupt, leaving the PCINT one free for whatever you want to do with it.
Still has all the other restrictions associated with software implementations of serial.