adafruit / Adafruit_DotStar

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

Convert to BusIO #47

Closed caternuson closed 2 years ago

caternuson commented 2 years ago

Non-breaking BusIO conversion.

Tested with PID 2328 strip and both HW and SW SPI on:

Test sketch, with SW pins changed as needed.

#include <Adafruit_DotStar.h>

#define NUMPIXELS 10 

// Hardware SPI
Adafruit_DotStar strip(NUMPIXELS, DOTSTAR_BGR);

// Software SPI
//#define DATAPIN    10
//#define CLOCKPIN   11
//Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);

void setup() {
  strip.begin();
  strip.fill(0xFF0000);
  strip.show();
  delay(1000);
  strip.fill(0x00FF00);
  strip.show();
  delay(1000);
  strip.fill(0x0000FF);
  strip.show();
  delay(1000);
}

void loop() {
}
ladyada commented 2 years ago

we have to update/release busio first right?

caternuson commented 2 years ago

Yah, I think so. Otherwise pinMode() will get called on a -1 value.

caternuson commented 2 years ago

Done. https://github.com/adafruit/Adafruit_BusIO/releases/tag/1.10.3