0
0
Arduinoprogramming~10 mins

Bluetooth with HC-05/HC-06 module in Arduino - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the serial communication with the HC-05 module at 9600 baud rate.

Arduino
Serial[1](9600);
Drag options to blanks, or click blank then click option'
Aprint
Bbegin
Cread
Dwrite
Attempts:
3 left
💡 Hint
Common Mistakes
Using print instead of begin to start communication.
Trying to read or write before starting communication.
2fill in blank
medium

Complete the code to read data from the Bluetooth module when available.

Arduino
if (Serial.available() [1] 0) {
  char data = Serial.read();
}
Drag options to blanks, or click blank then click option'
A<=
B<
C>
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using == 0 which means no data available.
Using less than operators which are incorrect here.
3fill in blank
hard

Fix the error in the code to send a string "Hello" over Bluetooth.

Arduino
Serial.[1]("Hello");
Drag options to blanks, or click blank then click option'
Aread
Bavailable
Cbegin
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using read which reads data instead of sending.
Using begin which initializes communication.
4fill in blank
hard

Fill both blanks to create a Bluetooth serial object on pins 10 (RX) and 11 (TX).

Arduino
SoftwareSerial bluetooth([1], [2]);
Drag options to blanks, or click blank then click option'
A10
B9
C11
D12
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping RX and TX pins.
Using pins not connected to the module.
5fill in blank
hard

Fill all three blanks to send the character 'A' only if data is available from Bluetooth.

Arduino
if (bluetooth.[1]() [2] 0) {
  bluetooth.[3]('A');
}
Drag options to blanks, or click blank then click option'
Aavailable
B>
Cprint
Dread
Attempts:
3 left
💡 Hint
Common Mistakes
Using read() instead of available() to check data.
Using < or == instead of > for comparison.
Using read() to send data.