Skip to content

Commit 7a549fb

Browse files
authored
Merge pull request #56 from caternuson/onboard_example
Update onboard example
2 parents a65dbdb + 8681415 commit 7a549fb

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

examples/onboard/.funhouse.test.only

Whitespace-only changes.

examples/onboard/.gemma_m0.test.only

Whitespace-only changes.

examples/onboard/.trinket_m0.test.only

Whitespace-only changes.

examples/ItsyBitsyM4Onboard/ItsyBitsyM4Onboard.ino renamed to examples/onboard/onboard.ino

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
// An example demonstrating how to control the Adafruit Dot Star RGB LED
2-
// included on board the ItsyBitsy M4 board.
1+
// An example demonstrating how to control the onboard DotStar RGB LED
2+
// Works for the following boards:
3+
// Adafruit ItsyBitsy M0 Express
4+
// Adafruit ItsyBitsy M4
5+
// Adafruit ItsyBitsy nRF52840
6+
// Adafruit Trinket M0
7+
// Adafruit PyRuler
8+
// Adafruit FunHouse
9+
// Adafruit GEMMA M0
310

411
#include <Adafruit_DotStar.h>
512

6-
// There is only one pixel on the board
7-
#define NUMPIXELS 1
8-
9-
//Use these pin definitions for the ItsyBitsy M4
10-
#define DATAPIN 8
11-
#define CLOCKPIN 6
12-
13-
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
13+
// Everything is defined in the Board Support Package
14+
// DOTSTAR_NUM number of onboard DotStars (typically just 1)
15+
// PIN_DOTSTAR_DATA onboard DotStar data pin
16+
// PIN_DOTSTAR_CLK onboard DotStar clock pin
17+
Adafruit_DotStar strip(DOTSTAR_NUM, PIN_DOTSTAR_DATA, PIN_DOTSTAR_CLK, DOTSTAR_BRG);
1418

1519
void setup() {
1620
strip.begin(); // Initialize pins for output
@@ -23,7 +27,6 @@ void loop() {
2327
}
2428

2529

26-
2730
// Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
2831
void rainbow(int wait) {
2932
// Hue of first pixel runs 5 complete loops through the color wheel.

0 commit comments

Comments
 (0)