Test Code 8:
********************************************************************************************************************
void setup()
{
Serial.begin(9600);
}
void loop()
{
char val;
// define a variable, used to receive the value read from Bluetooth.
if(Serial.available())
{
val = Serial.read();
Serial.println(val);
}
}
********************************************************************************************************************
Test Result:
Upload the code, hookup well and power up. After connecting the Bluetooth APP, open the serial monitor and set
the baud rate to 9600, press down the control key on the APP, you should see the corresponding value. Shown
// set the serial baud rate to 9600
// if receive the value
// assign the value read to val
204
Need help?
Do you have a question about the 4DOF and is the answer not in the manual?
Questions and answers