I am trying to use the SoftwareSerial.h in a GPS project but it won't find the library anymore. I used it 3 months ago in a other project with a arduino uno wifi rev2 and everything worked just fine. I am using a Arduino nano BLE33 right now.
#include <SoftwareSerial.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Error:
Arduino: 1.8.19 (Windows 10), Board: "Arduino Nano 33 BLE"
// I cut the unrelated stuff out
Alternatives for SoftwareSerial.h: []
ResolveLibrary(SoftwareSerial.h)
-> candidates: []sketch_feb25c:1:10: fatal error: SoftwareSerial.h: No such file or directory
#include <SoftwareSerial.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
SoftwareSerial.h: No such file or directory
In reference to UKHeliBob's question about why you need SoftwareSerial with the Nano BLE 33, were you aware the UNO WiFi Rev2 also has four hardware serial ports, or did you need a 5th port for some reason?
Unless you are doing something specific to SoftwareSerial, such as switching the listening port between multiple SoftwareSerial ports, the only change would be in the constructor for the port.
Unless things have changed , there is no SoftwareSerial for the Nano BLE 33, so you will need to use a different board if you require the used of SoftwareSerial.
As far as I can find, there is no SoftwareSerial library for the Nano 33 BLE. The Tx/Rx pins are Serial1, separate from Serial on the USB connection, and an additional hardware serial port is available which can be assigned to any of the pins you desire. Apparently noone has seen the need to write a SoftwareSerial implementation for the board.
The implementation of the SoftwareSerial library is specific to a board or type of board because of the different processors used on them. Versions of the library for each board type are installed when the board files are installed. The library uses low level access to processor registers in order to work and not all processors have the same registers
When you #include the library it is the version for your target board that is pulled into the sketch. So, if the providers of the board files that support a particular board do not provide a version of the library then you will get the "no such file or directory" error.