Skip to content

Commit c7d9e2f

Browse files
authored
Merge pull request #449 from makermelissa/master
Updated bluefruit_playground to compile on Bluefruit Feather Sense
2 parents 9c64714 + 6b241b2 commit c7d9e2f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ uint16_t measure_button(uint8_t* buf, uint16_t bufsize)
142142

143143
uint32_t button = 0;
144144
button |= ( digitalRead(PIN_BUTTON1) ? 0x00 : 0x02 );
145-
button |= ( digitalRead(PIN_BUTTON2) ? 0x00 : 0x04 );
146-
145+
#if defined(PIN_BUTTON2)
146+
button |= ( digitalRead(PIN_BUTTON2) ? 0x00 : 0x04 );
147+
#endif
147148
memcpy(buf, &button, 4);
148149
return 4;
149150
}
@@ -177,7 +178,9 @@ void setup()
177178

178179
// Button
179180
pinMode(PIN_BUTTON1, INPUT_PULLUP);
180-
pinMode(PIN_BUTTON2, INPUT_PULLUP);
181+
#if defined(PIN_BUTTON2)
182+
pinMode(PIN_BUTTON2, INPUT_PULLUP);
183+
#endif
181184

182185
apds9960.begin();
183186
apds9960.enableColor(true);
@@ -251,7 +254,9 @@ void setup()
251254
bleButton.begin(measure_button, 100);
252255
bleButton.setPeriod(0); // only notify if there is changes with buttons
253256

254-
bleTone.begin(PIN_BUZZER);
257+
#if defined(PIN_BUZZER)
258+
bleTone.begin(PIN_BUZZER);
259+
#endif
255260

256261
strip.begin();
257262
blePixel.begin(&strip);

0 commit comments

Comments
 (0)