www.keyestudio.com
}
void loop()
{
char val;
// define a variable, used to receive the value read from Bluetooth.
if(Serial.available())
{
val = Serial.read();
Serial.println(val);
}
}
After connecting Bluetooth module, open serial port monitor to set baud rate to
9600. Press control keys on App, the serial port prints out the corresponding
control character. As shown below:
// if receive the value
// assign the value read to val
166