Complete the code to initialize the Bluetooth serial communication at 9600 baud rate.
void setup() {
Serial.begin([1]);
}The standard baud rate for Bluetooth serial communication is 9600.
Complete the code to send the string "Hello" over Bluetooth.
void loop() {
Serial.[1]("Hello");
delay(1000);
}read which is for receiving data.available which checks incoming data.The print function sends data as readable text over serial.
Fix the error in the code to read a character from Bluetooth and store it in variable 'c'.
char c;
void loop() {
if (Serial.[1]() > 0) {
c = Serial.read();
}
}write() which sends data, not checks availability.print() which sends data.available() checks if data is ready to read from serial.
Fill both blanks to send the integer variable 'value' as a string over Bluetooth.
int value = 123; void loop() { Serial.[1](String([2])); delay(1000); }
write which sends raw bytes, not readable text.Use print to send text, and convert the integer value to a string.
Fill all three blanks to read a line from Bluetooth and store it in 'inputString'.
String inputString = ""; void loop() { if (Serial.[1]() > 0) { char c = Serial.[2](); if (c == [3]) { // end of line } else { inputString += c; } } }
write() instead of read().Check if data is available, read one character, and detect newline '\n' as line end.
