Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
temp work
  • Loading branch information
hathach committed Feb 17, 2020
commit 8c5c66ef17e520d4e6c987d23d2ec740ffc25a15
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ BLEAdafruitAddressablePixel blePixel;
#elif defined ARDUINO_NRF52840_CLUE
#include <Adafruit_APDS9960.h>
#include <Adafruit_LSM6DS33.h>
#include <Adafruit_BMP280.h>

#define DEVICE_NAME "CLUE"
#define NEOPIXEL_COUNT 1

Adafruit_APDS9960 apds9960;
Adafruit_LSM6DS33 lsm6ds33;
Adafruit_BMP280 bmp280;
#else
#error "Board is not supported"
#endif
Expand Down Expand Up @@ -84,10 +86,14 @@ uint16_t measure_button(uint8_t* buf, uint16_t bufsize)

uint16_t measure_temperature(uint8_t* buf, uint16_t bufsize)
{
float temp;
#if defined ARDUINO_NRF52840_CIRCUITPLAY
float temp = CircuitPlayground.temperature();
memcpy(buf, &temp, 4);
temp = CircuitPlayground.temperature();
#else
temp = bmp280.readTemperature();
#endif

memcpy(buf, &temp, 4);
return 4;
}

Expand Down Expand Up @@ -156,9 +162,10 @@ void setup()

// Accelerometer
lsm6ds33.begin_I2C();
#endif


// Pressure + Temperature
bmp280.begin();
#endif

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