Commit c7045e25769b05d46f140256555c20c0fab62091
1 parent
c99c96d6
RFduino BLE comm
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +void blesetup(){ | ||
2 | + RFduinoBLE.advertisementData = "Hello"; // shouldnt be more than 10 characters long | ||
3 | + RFduinoBLE.deviceName = "RF J"; // name of your RFduino. Will appear when other BLE enabled devices search for it | ||
4 | + RFduinoBLE.begin(); // begin | ||
5 | +} | ||
6 | + | ||
7 | +void sendDataBLE(int lap, int lapTime, int isEnd){ | ||
8 | + char chr[20]; | ||
9 | + String str1, str2, str3, strAll; | ||
10 | + str1=String(lap); | ||
11 | + str2=String(lapTime); | ||
12 | + str3=String(isEnd); | ||
13 | + strAll=str3+";"+str1+";"+str2; | ||
14 | + strAll.toCharArray(chr, 20); | ||
15 | + RFduinoBLE.send(chr, strAll.length()); | ||
16 | + //RFduino_ULPDelay(3000); | ||
17 | +} | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |