HI
when I try this small sketch its working fine
#include "UART.h" //моя библиотека HardwareSerial которая наследует nStream.h которая наследует nPrint.h
//внутри происходит UART serial;
#define USE_LOG
#ifdef USE_LOG
#include "NeoSWSerial.h" //штатная HardwareSerial, которая наследует Stream.h которая наследует Print.h
#endif
#ifdef USE_LOG
NeoSWSerial terminal(6, 7); //receivePin, transmitPin
#endif
void setup() {
serial.begin(9600); //57600 is max for SIM800
#ifdef USE_LOG
terminal.begin(9600);
#endif
serial << F("serial");
terminal.print(F("terminal"));
}
void loop() {
while ( serial.available() ) {
terminal.write( serial.read() );
}
while ( terminal.available() ) {
serial.write( terminal.read() );
}
}
void flag_blinking() {
}
when I add many other code - but w/o changing library, pins for rx/tx, etc - then I get error
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816/NeoSW.ino.elf" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816\\sketch\\NeoSW.ino.cpp.o" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816\\libraries\\NeoSWSerial\\NeoSWSerial.cpp.o" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816/..\\arduino_cache_692159\\core\\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816" -lm
C:\Users\A\AppData\Local\Temp\arduino_build_188816\libraries\NeoSWSerial\NeoSWSerial.cpp.o (symbol from plugin): In function `NeoSWSerial::read()':
(.text+0x0): multiple definition of `__vector_3'
C:\Users\A\AppData\Local\Temp\arduino_build_188816\sketch\NeoSW.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library NeoSWSerial at version 3.0.5 in folder: C:\Users\A\Documents\Arduino\libraries\NeoSWSerial
exit status 1
I cannot understand why and whats wrong with NeoSWSerial::read() ?
I have in my sketch INT on pins 2,3
I have also PCINT on pins 12,13,14,15
could this error be because Im using these INT?