I was able to change the name of my HC-05 Bluetooth module in AT mode, using:
Serial.println("AT+NAME=NEWNAME");
HC-05 namely expects \r\n at the end.
Serial.write() doesn't seem to want to transmit these characters.
However, changing the PIN doesn't work.
Using Serial.read(), I wrote the input directly in the terminal with the CR LF option switched on. It didn't work. It did work by using quotation marks: AT+PSWD="9876".
I tried to insert the new findings in my automated program:
Serial.println("AT+PSWD=\"9876\"");
This returns ERROR(1D) or ERROR(0).
Does anyone have an idea why this particular command fails to work, whilst the other commands do work and with the remaining code unchanged?