Keyestudio Ks0428 Manual page 122

Table of Contents

Advertisement

www.keyestudio.com
char ble_val; //character variable: save the value of Bluetooth
reception
void setup() {
Serial.begin(9600);
}
void loop() {
if(Serial.available() > 0)
buffer
{
ble_val = Serial.read(); //Read data from serial buffer
Serial.println(ble_val); //Print
}}
//*******************************************
(There will be contradiction between serial communication of code
and communication of Bluetooth when uploading code, therefore,
don't link with Bluetooth module before uploading code.)
After uploading code on development board, then insert Bluetooth
module, wait for the command from cellphone.
//make sure if there is data in serial
122

Advertisement

Table of Contents
loading

Table of Contents