Brandon Donohue / Mbed 2 deprecated IoTBattleship

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bluetoothFunc.h Source File

bluetoothFunc.h

00001 bool bluetoothFunc(int& num, int& upOrDown){
00002     char bnum = blue.getc(); 
00003     bool dataValid = false;
00004     if (bnum =='!') {
00005         bnum = blue.getc(); 
00006         if (bnum == 'B') {
00007             bnum = blue.getc(); 
00008             num = bnum - '0'; 
00009             upOrDown = blue.getc() - '0';
00010             dataValid = true;
00011         } 
00012     } 
00013     if(dataValid){
00014         return true;   
00015     } else {
00016         return false;   
00017     }
00018 }