adafruit / Adafruit_DotStar

GNU General Public License v3.0
98 stars 58 forks source link

Example ItsyBitsyM4Onboard Update Suggestion #35

Closed DamianSuess closed 1 year ago

DamianSuess commented 4 years ago

When following the example code for the ItsyBitsyM4 Onboard, it was not clear which Data/Cock Pin numbers to use for the Gemma M0 without prior knowledge of the board's schematics or pinouts.

As a suggestion, could the example code be simplified to use "internal" DotStar #defines such as INTERNAL_DS_DATA and INTERNAL_DS_CLK? After doing a quick skim of the framework-arduinosam package library, it appears that most of the boards with an on-board DotStar define this in their variant.h file.

Example

// ...
Adafruit_DotStar _dotStar(NUMPIXELS, INTERNAL_DS_DATA, INTERNAL_DS_CLK, strip);
// ...

Versus the current example, which the user must look up their board's data/clock pin numbers.

// ...
//Use these pin definitions for the ItsyBitsy M4
#define DATAPIN    8
#define CLOCKPIN   6

Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
// ...

Please correct me if this is an unsupported #define to use for on-board DotStars. Thank you and keep up the great work!

caternuson commented 2 years ago

Having some #defs like INTERNAL_DS_* would be neat. But there's really no standard for that and therefore potential variability between boards. So that could end up being another source of confusion.

As a simpler approach, can just add a new dedicated example for Gemma M0. Checkout the example code in PR #45.

caternuson commented 1 year ago

Closing. See new example added with #56.

The new BSP provided defines for DotStar are: