Software serial library (mySerial.write and Serial.write)

While using bluetooth serial communication (using the software serial library) mySerial.write writes to the BT whereas Serial.write writes to the serial monitor? Am I understanding this correctly? I do not have an android app through which I can check the same! Thank you in advance!

Yes, if you use software serial, that is the way you would do it. You are not always obliged to use software serial, and you often don't need to.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

Nick_Pyner:
Yes, if you use software serial, that is the way you would do it. You are not always obliged to use software serial, and you often don’t need to.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

Thank you! I shall have a look at them!
I am using a BT device and to upload the program, I need to disconnect the TX, RX pins each time. I wanted to avoid that which is why I am trying to use this!

abhir24: I need to disconnect the TX, RX pins each time.

A small price to pay, as explained.

Nick_Pyner:
A small price to pay, as explained.

In terms of it making the program slower than the case where I do not use software serial. I shall take your advice and decide if it is absolutely necessary and only then use it! Thank you!

abhir24: mySerial.write writes to the BT

Only if you name your SoftwareSerial instance mySerial. But don't do that. It's a dumbass name that only belongs in example code. If it is connected to a bluetooth, then name it bluetooth or bt or something that lets you know what it is connected to. That makes it a lot easier to figure out later when you are reading through the code.

abhir24: In terms of it making the program slower than the case where I do not use software serial.

Check the notes. There is more to it than that. Using proper hardware serial means you can test the serial code with the serial monitor, i.e. prove your bluetooth code is 100% kosher without even using a bluetooth device. This can do wonders for your confidence.

Delta_G: Only if you name your SoftwareSerial instance mySerial. But don't do that. It's a dumbass name that only belongs in example code. If it is connected to a bluetooth, then name it bluetooth or bt or something that lets you know what it is connected to. That makes it a lot easier to figure out later when you are reading through the code.

Thank you for that DeltaG! Yep, I understood the part where mySerial was the name because the it was named so earlier!

Nick_Pyner: Check the notes. There is more to it than that. Using proper hardware serial means you can test the serial code with the serial monitor, i.e. prove your bluetooth code is 100% kosher without even using a bluetooth device. This can do wonders for your confidence.

I haven't been able to read it completely. I will do it pronto!