From 6b241b265113200cf0568ab0341665cffba505b5 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 4 Mar 2020 14:29:49 -0800 Subject: [PATCH] Updated bluefruit_playground to compile on Bluefruit Feather Sense --- .../bluefruit_playground/bluefruit_playground.ino | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/bluefruit_playground.ino b/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/bluefruit_playground.ino index eb9c0ae9..d0258696 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/bluefruit_playground.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/bluefruit_playground.ino @@ -142,8 +142,9 @@ uint16_t measure_button(uint8_t* buf, uint16_t bufsize) uint32_t button = 0; button |= ( digitalRead(PIN_BUTTON1) ? 0x00 : 0x02 ); - button |= ( digitalRead(PIN_BUTTON2) ? 0x00 : 0x04 ); - + #if defined(PIN_BUTTON2) + button |= ( digitalRead(PIN_BUTTON2) ? 0x00 : 0x04 ); + #endif memcpy(buf, &button, 4); return 4; } @@ -177,7 +178,9 @@ void setup() // Button pinMode(PIN_BUTTON1, INPUT_PULLUP); - pinMode(PIN_BUTTON2, INPUT_PULLUP); + #if defined(PIN_BUTTON2) + pinMode(PIN_BUTTON2, INPUT_PULLUP); + #endif apds9960.begin(); apds9960.enableColor(true); @@ -251,7 +254,9 @@ void setup() bleButton.begin(measure_button, 100); bleButton.setPeriod(0); // only notify if there is changes with buttons - bleTone.begin(PIN_BUZZER); + #if defined(PIN_BUZZER) + bleTone.begin(PIN_BUZZER); + #endif strip.begin(); blePixel.begin(&strip);