Skip to content

Commit 8c5c66e

Browse files
committed
temp work
1 parent da841fa commit 8c5c66e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/bluefruit_playground.ino

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ BLEAdafruitAddressablePixel blePixel;
4949
#elif defined ARDUINO_NRF52840_CLUE
5050
#include <Adafruit_APDS9960.h>
5151
#include <Adafruit_LSM6DS33.h>
52+
#include <Adafruit_BMP280.h>
5253

5354
#define DEVICE_NAME "CLUE"
5455
#define NEOPIXEL_COUNT 1
5556

5657
Adafruit_APDS9960 apds9960;
5758
Adafruit_LSM6DS33 lsm6ds33;
59+
Adafruit_BMP280 bmp280;
5860
#else
5961
#error "Board is not supported"
6062
#endif
@@ -84,10 +86,14 @@ uint16_t measure_button(uint8_t* buf, uint16_t bufsize)
8486

8587
uint16_t measure_temperature(uint8_t* buf, uint16_t bufsize)
8688
{
89+
float temp;
8790
#if defined ARDUINO_NRF52840_CIRCUITPLAY
88-
float temp = CircuitPlayground.temperature();
89-
memcpy(buf, &temp, 4);
91+
temp = CircuitPlayground.temperature();
92+
#else
93+
temp = bmp280.readTemperature();
9094
#endif
95+
96+
memcpy(buf, &temp, 4);
9197
return 4;
9298
}
9399

@@ -156,9 +162,10 @@ void setup()
156162

157163
// Accelerometer
158164
lsm6ds33.begin_I2C();
159-
#endif
160-
161165

166+
// Pressure + Temperature
167+
bmp280.begin();
168+
#endif
162169

163170
// Setup the BLE LED to be enabled on CONNECT
164171
// Note: This is actually the default behaviour, but provided

0 commit comments

Comments
 (0)