You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently the ESP8266 board manager ver. 2.6.0 was released. Several changes that had been in the works regarding SoftwareSerial were implemented. As a result the sample code for this project will no longer compile. @dok-net provided this explanation:
Software serial can handle the diagnostics to USB quite well, whereas using the HW UART for the real application is in almost any scenario the superior option. I can’t even begin to imagine why all those libraries never considered
Serial.swap();
Now, if you’re faced with this situation, it’s only fair that I give you the simple change that needs to be done to the sources:
Before, somewhere in the sketch, provided that RX and TX are defines for the RX and TX pin numbers respectively:
I hope you see the beauty of it – it makes it simpler to switch to HW UART, and it’s a bit easier on the eye. Plus, switching bitrate at runtime should not involve the constructor!
As a result, I believe that example code should be revised as shown below. Please note, I was not able to test it other than making sure it compiled!
I have not retested but it may no longer be necessary. Since my post The serial library has been revised two more time (one still in the release process). The Intent of the changes were to resolve various compatibility issues.
Recently the ESP8266 board manager ver. 2.6.0 was released. Several changes that had been in the works regarding SoftwareSerial were implemented. As a result the sample code for this project will no longer compile. @dok-net provided this explanation:
Software serial can handle the diagnostics to USB quite well, whereas using the HW UART for the real application is in almost any scenario the superior option. I can’t even begin to imagine why all those libraries never considered
Serial.swap();
Now, if you’re faced with this situation, it’s only fair that I give you the simple change that needs to be done to the sources:
Before, somewhere in the sketch, provided that RX and TX are defines for the RX and TX pin numbers respectively:
Now, for quite awhile:
Where for the HW UART things would be:
I hope you see the beauty of it – it makes it simpler to switch to HW UART, and it’s a bit easier on the eye. Plus, switching bitrate at runtime should not involve the constructor!
As a result, I believe that example code should be revised as shown below. Please note, I was not able to test it other than making sure it compiled!
The text was updated successfully, but these errors were encountered: