Complete the code to initialize the serial communication with the HC-05 module at 9600 baud rate.
Serial[1](9600);
The begin function starts serial communication at the specified baud rate.
Complete the code to read data from the Bluetooth module when available.
if (Serial.available() [1] 0) { char data = Serial.read(); }
The Serial.available() function returns the number of bytes available to read. We check if it is greater than 0 to read data.
Fix the error in the code to send a string "Hello" over Bluetooth.
Serial.[1]("Hello");
To send data over serial, use print or println. Here, print sends the string.
Fill both blanks to create a Bluetooth serial object on pins 10 (RX) and 11 (TX).
SoftwareSerial bluetooth([1], [2]);
The HC-05 module connects to Arduino pins 10 (RX) and 11 (TX) using SoftwareSerial.
Fill all three blanks to send the character 'A' only if data is available from Bluetooth.
if (bluetooth.[1]() [2] 0) { bluetooth.[3]('A'); }
read() instead of available() to check data.read() to send data.Check if data is available with available(), compare with > 0, then send 'A' using print.