EasyManua.ls Logo

Keyestudio 4DOF - Page 207

Keyestudio 4DOF
276 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
204
Test Code 8:
********************************************************************************************************************
void setup()
{
Serial.begin(9600); // set the serial baud rate to 9600
}
void loop()
{
char val; // define a variable, used to receive the value read from Bluetooth.
if(Serial.available()) // if receive the value
{
val = Serial.read(); // assign the value read to val
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

Related product manuals