Maxim Integrated's IoT development kit.
Dependencies: MAX30101 MAX30003 MAX113XX_Pixi MAX30205 max32630fthr USBDevice
Diff: main.cpp
- Revision:
- 3:7e9a93b6b82b
- Parent:
- 2:68ffd74e3b5c
- Child:
- 4:cc427aa37aee
--- a/main.cpp Thu Mar 15 17:13:40 2018 +0300 +++ b/main.cpp Fri Mar 16 22:44:22 2018 +0300 @@ -119,8 +119,8 @@ #if defined(LIB_MAX113XX_PIXI) UUID uuidADC("00001527-1d66-11e8-b467-0ed5f89f718b"); static float ADCInitValue = 2.5; -ReadOnlyGattCharacteristic<float> gattCharADC(uuidADC, &ADCInitValue, - GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY); +ReadOnlyGattCharacteristic<uint16_t> gattCharADC(uuidADC, &ADCInitValue, + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY); #endif #if defined(LIB_MAX30205) @@ -821,7 +821,7 @@ const int EINT_STATUS = 1 << 23; const int RTOR_STATUS = 1 << 10; const int RTOR_REG_OFFSET = 10; - const float RTOR_LSB_RES = 0.008f; + const float RTOR_LSB_RES = 0.0078125f; const int FIFO_OVF = 0x7; const int FIFO_VALID_SAMPLE = 0x0; const int FIFO_FAST_SAMPLE = 0x1; @@ -919,7 +919,7 @@ daplink.printf("ADC Read is : %i,\tVoltage is %1.3f V \r\n", adcData, adcVoltage); - bleGattAttrWrite(gattCharADC.getValueHandle(), (uint8_t *)&adcVoltage, sizeof(adcVoltage)); + bleGattAttrWrite(gattCharADC.getValueHandle(), (uint8_t *)&adcData, sizeof(adcData)); Thread::wait(MAX113XX_PIXI_BLE_NOTIFY_PERIOD_SEC * 1000); }