Hello!
(this is my first post, if i have used the wrong tag tell me)
As you might of read from the title, when I connect the bluetooth module to my phone it works fine. However, when I try to connect it to my computer (windows 10) it disconnects after about 2 seconds.
Board: Mega2560
Wiring: ( for the HC-05 )
VCC - 5V
GND - GND
TX - RX
RX - TX
EDIT: the code is just the standardFirmata code from the firmata library.
I guess that proves there is nothing wrong with Bluetooth, your code, or the connections. One can therefore only guess that the problem is with your terminal in the PC, and who would know what that is? One is much the same as another but you might try RealTerm. It is pretty intuitive, and commonly used.