This is an example to broadcast measured value of BME280 through BLE GATT service.
please refer detail information at GitHub. https://github.com/soramame21/BLE_Server_BME280
Diff: source/main.cpp
- Revision:
- 1:9d1a3835d884
- Parent:
- 0:f22fa5cc4d56
- Child:
- 3:4b41a1ba65c8
--- a/source/main.cpp Fri Apr 14 02:51:57 2017 +0000
+++ b/source/main.cpp Thu Jul 13 14:00:52 2017 +0900
@@ -10,11 +10,12 @@
DigitalOut led1(LED1);
DigitalOut led2(LED2);
+#define SMALL_STACK_SIZE 960 //reduced thread stack size (default:2048)
+
#if defined(TARGET_LPC1768)
BME280 sensor(p28, p27);
#elif defined(TARGET_TY51822R3)
BME280 sensor(I2C_SDA0, I2C_SCL0);
-#define SMALL_STACK_SIZE 960 //reduced thread stack size (default:2048)
#else
BME280 sensor(I2C_SDA, I2C_SCL);
#endif
@@ -71,7 +72,7 @@
EvnSer->updateHumidity(tmp_h);
printf("%04.2f hPa, %2.2f degC, %2.2f %%\r\n", tmp_p, tmp_t, tmp_h );
}
- Thread::wait(1000);
+ Thread::wait(1000);
}
}
@@ -91,7 +92,7 @@
/************************ Thread #3 main() ************************/
int main() {
-// printf("Inside main\r\n");
+// printf("Inside main\r\n");
// reduced following stack size to 960 x 2 (default stack size: 2048 x 2)
Thread thread1(osPriorityNormal,SMALL_STACK_SIZE,NULL);
Thread thread2(osPriorityNormal,SMALL_STACK_SIZE,NULL);