may i know what does it mean by "Serial" will go over the USB ?
And what is the difference to Serial1 ? ( in terms of how it works, what the results would in terms of speed, etc )
I ran into trouble because the GPS sensor and the air quality sensor by plantower both uses SoftwareSerial .
in R4 are there SoftwareSerial and SoftwareSerial1 ?
The one named Serial communicates with the PC using the USB cable plugged into the R4. It is used to upload code and to interact with the Serial monitor in the IDE
The other one, named Serial1, uses pins 0 and 1 of the R4 to communicate with devices, such as a GPS, attached to those pins.
To use Serial1 just refer to it by its name as you would Serial. For instance, Serial1.begin(115200);Serial1.read(); etc
I don't know whether a special version of SoftwareSerial is needed for the R4, but I expect it would be
On a regular Uno you cannot sensibly use 2 instances of SoftwareSerial
when running PM2.5 plantower sensor and GPS sensor at the same time ;
If i declare pmsSerial.begin(9600) FIRST, the GPS part will not output anything
if i declare gpsSerial.begin(9600) FIRST , the PMS(pm2.5) part will not output anything So i applied this https://docs.arduino.cc/tut.../communication/TwoPortReceive/
on arduino Uno R3 and it worked but when i apply it to R4 Wifi , it says
"class SoftwareSerial' has no member named 'listen'. "
Do not use SoftwareSerial on pins 0 and 1 of any Uno
As previously explained you can just use Serial1 on pins 0 and 1 of an R4. If SoftwareSerial works on other pins of the R4 then connect one serial device to pins 0 and 1 and use Serial1 and the second device to the pins used by SoftwareSerial
One thing to take into account could be that SoftwareSerial does not work reliably, if at all, at 115200 baud on the Uno R3 so may struggle at that baud rate even on an R4