Open vongomben opened 5 months ago
This Neopizel integration is a big opportunity to introduce in Codecraft for Wio terminal the pin declaration. My idea is that you can name more strips, on different pins, th left or right Grove connector on the Wio, ora a custom one (which should become the self defined when used with Arduino?)
Left stands for BCM3
, right stands for BCM27
This block revolves around this declaration:
Which basically calls:
#include <Adafruit_NeoPixel.h>
and
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
And
void setup() {
strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}
strip.show
strip.clear();
I would add all functions in strandtest: ColorWipe
colorWipe(<stripName>.Color(r, g, b), ms);
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM)
strip.show(); // Update strip to match
delay(wait); // Pause for a moment
}
}
theaterChase(strip.Color(127, 127, 127), 50); // White, half brightness
void theaterChase(uint32_t color, int wait) {
for(int a=0; a<10; a++) { // Repeat 10 times...
for(int b=0; b<3; b++) { // 'b' counts from 0 to 2...
strip.clear(); // Set all pixels in RAM to 0 (off)
// 'c' counts up from 'b' to end of strip in steps of 3...
for(int c=b; c<strip.numPixels(); c += 3) {
strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
}
strip.show(); // Update strip with new contents
delay(wait); // Pause for a moment
}
}
}
Can you update the Chainable LED to the Neopixel Led with the official neopixel library?