Browse Source

Functions for compatibility with Adafruit NeoPixel

main_ledos
PaulStoffregen 5 years ago
parent
commit
4f71dd15b8
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      WS2812Serial.h

+ 10
- 0
WS2812Serial.h View File

uint16_t numPixels() { uint16_t numPixels() {
return numled; return numled;
} }
// Functions for compatibility with Adafruit_NeoPixel
void setPixelColor(uint16_t num, uint32_t color) {
setPixel(num, color);
}
void setPixelColor(uint16_t num, uint8_t red, uint8_t green, uint8_t blue) {
setPixel(num, red, green, blue);
}
uint32_t Color(uint8_t red, uint8_t green, uint8_t blue) {
return (red << 16) | (green << 8) | blue;
}
private: private:
const uint16_t numled; const uint16_t numled;
const uint8_t pin; const uint8_t pin;

Loading…
Cancel
Save