Algoritmo funcionando com a biblioteca de inatividade utilizando dos dados do acelerômetro e a biblioteca de PeakSearch se utilizando dos dados filtrados pelo filtro Kalman.
Dependencies: mbed MatrixMath Matrix nrf51_rtc BMP180 MPU9250
Diff: ble_comands.h
- Revision:
- 0:095b19b8fb7e
- Child:
- 1:d1002dc109b9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ble_comands.h Thu Mar 07 23:30:19 2019 +0000 @@ -0,0 +1,51 @@ +#include "ble_config.h" + +char data_ble[100]; +int flag_ble=0; + +void onDataWritten(const GattWriteCallbackParams *params) +{ + + char alc[10]; + memset(data_ble, 0, sizeof(data_ble)); + if ((params->handle == uart->getTXCharacteristicHandle())) + { + for(int x=0; x < params->len; x++) + { + sprintf(alc,"%c", params->data[x]); + strcat(data_ble,alc); + }// end for + if(strcmp(data_ble,"Start")== 0||strcmp(data_ble,"Start ")== 0||flag_ble!=0) + { + flag_ble=flag_ble+1; + } //end if "Start" + }// end if params... +} //end onDataWritten + +void getting_pacient_data() +{ + char dia[20]; + char horario[20]; + + ble.onEventsToProcess(scheduleBleEventsProcessing); + ble.init(bleInitComplete); + ble.onDataWritten(onDataWritten); + ble.waitForEvent(); + while(flag_ble!=4) + { + ble.waitForEvent(); + if(flag_ble==1) + { + uart->writeString("Theshould"); + uart->writeString("\n"); + flag_ble=flag_ble+1; + } + if(flag_ble==3) + { + Calibration=atof(data_ble); + uart->writeString("Gravando..."); + uart->writeString("\n"); + flag_ble=flag_ble+1; + } + } //end while flag_ble !=4 +} //end getting_pacient_data \ No newline at end of file