StefanL38:
How can I determine which library is used if I code something like
Do this:
- File > Preferences
- Check the box next to "Show verbose output during: compilation".
- Click the "OK" button.
- Compile a sketch that contains the #include directive for the library.
After the compilation finishes, examine the contents of the black console pane in the Arduino IDE window. Near the bottom of the output, you will see something like this:
Using library SoftwareSerial at version 1.0 in folder: C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.2\libraries\SoftwareSerial
Note that the library that gets used may depend on which board you have selected from the Tools > Board menu
The SoftwareSerial library is architecture specific, so the platform for each microcontroller architecture provides its own version of the SoftwareSerial library. In the example above, I had Tools > Board > Arduino Uno selected, so the SoftwareSerial library bundled with the Arduino AVR Boards platform was used. If I select Tools > Board > LOLIN(WEMOS) D1 R2 & mini, the output shows:
Using library SoftwareSerial at version 6.4.0 in folder: C:\Users\per\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SoftwareSerial
so you can see the version of the library bundled with the ESP8266 core for Arduino platform was used this time.
You might not notice that a different library is being used from one board to another because the authors of these libraries will generally design them so the interface is the same, even though the source code behind that interface may be very different.
StefanL38:
Some pages mention since IDE-Version 1.x NewSoftSerial is the new SoftSerial.
That information only applies when you are using a board of the AVR architecture (e.g., Uno, Nano, Leonardo, Mega). Back in the days when that information was written, all Arduino boards were of the AVR architecture, so people didn't bother to specify which architecture they were talking about. Now, we have support for dozens of architectures.
StefanL38:
With the library-manager I have installed another Serial Library called ESPSoftwareSerial.
Because I'm coding for a WeMos D1-Mini ESP8266-Board.
That's not necessary. That library comes pre-installed with your installation of ESP8266 core for Arduino.