Skip to content

Commit eb16b2e

Browse files
committed
finish neomatrix example
1 parent 9e85c17 commit eb16b2e

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/neomatrix/neomatrix.ino

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@
1212
any redistribution
1313
*********************************************************************/
1414

15-
// This sketch is intended to be used with the NeoPixel control
16-
// surface in Adafruit's Bluefruit LE Connect mobile application.
17-
15+
/* How to run this sketch
16+
* - Connect Neopixel FeatherWing and Load sketch to Bluefruit52
17+
* - Connect using Bluefruit Connect LE app
18+
* - Send character using BLEUART
19+
* - Bluefruit will draw received character on Neopixel FeatherWing
20+
*
21+
* Note: due to the font is larger than 4x8 Neopixel Wing, you can
22+
* only see part of the characters (but you got the idea).
23+
* Run the sketch with larger Neopixel Matrix for complete demo
24+
*/
1825
#include <Arduino.h>
1926
#include <Adafruit_NeoPixel.h>
2027
#include <Adafruit_GFX.h>
@@ -58,8 +65,11 @@ void setup()
5865
{
5966
Serial.begin(115200);
6067
Serial.println(F("Adafruit Bluefruit NeoMatrix"));
61-
Serial.println(F("------------------------------------"));
68+
Serial.println(F("----------------------------"));
6269

70+
Serial.println();
71+
Serial.println("Please connect using Bluefruit Connect LE application");
72+
6373
// Config Neopixels Matrix
6474
matrix.begin();
6575
matrix.setTextWrap(false);
@@ -69,6 +79,7 @@ void setup()
6979
// Init Bluefruit
7080
Bluefruit.begin();
7181
Bluefruit.setName("Bluefruit52");
82+
Bluefruit.setConnectCallback(connect_callback);
7283

7384
// Configure and Start Device Information Service
7485
bledis.setManufacturer("Adafruit Industries");
@@ -99,6 +110,12 @@ void setupAdv(void)
99110
Bluefruit.ScanResponse.addName();
100111
}
101112

113+
void connect_callback(void)
114+
{
115+
Serial.println("Connected ! Please select 'Uart' tab and send any characters");
116+
}
117+
118+
102119
void loop()
103120
{
104121
// Echo received data

libraries/Bluefruit52Lib/examples/Peripheral/neopixel/neopixel.ino

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ BLEUart bleuart;
3737
void setup()
3838
{
3939
Serial.begin(115200);
40-
Serial.println(F("Adafruit Bluefruit Neopixel Test"));
41-
Serial.println(F("------------------------------------"));
40+
Serial.println("Adafruit Bluefruit Neopixel Test");
41+
Serial.println("------------------------------------");
4242

43+
Serial.println();
44+
Serial.println("Please connect using Bluefruit Connect LE application");
45+
4346
// Config Neopixels
4447
pixels.begin();
4548

4649
// Init Bluefruit
4750
Bluefruit.begin();
4851
Bluefruit.setName("Bluefruit52");
52+
Bluefruit.setConnectCallback(connect_callback);
4953

5054
// Configure and Start Device Information Service
5155
bledis.setManufacturer("Adafruit Industries");
@@ -76,6 +80,10 @@ void setupAdv(void)
7680
Bluefruit.ScanResponse.addName();
7781
}
7882

83+
void connect_callback(void)
84+
{
85+
Serial.println("Connected !! Please select 'Neopixles' tab, click 'Connect' and have fun");
86+
}
7987

8088
void loop()
8189
{

0 commit comments

Comments
 (0)