Blame view

ble.ino 558 Bytes
c7045e25   msekar   RFduino BLE comm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  void blesetup(){
    RFduinoBLE.advertisementData = "Hello"; // shouldnt be more than 10 characters long 
    RFduinoBLE.deviceName = "RF J"; // name of your RFduino. Will appear when other BLE enabled devices search for it 
    RFduinoBLE.begin(); // begin 
  }
  
  void sendDataBLE(int lap, int lapTime, int isEnd){
    char chr[20];
    String str1, str2, str3, strAll;
    str1=String(lap);
    str2=String(lapTime);
    str3=String(isEnd);
    strAll=str3+";"+str1+";"+str2;
    strAll.toCharArray(chr, 20);
    RFduinoBLE.send(chr, strAll.length());
    //RFduino_ULPDelay(3000);
  }