Completed Pixel Example

Example contains 1 NeoPixel RGB, 1 NeoPixel RGBW, and 1 DotStar RGB.
Tested on ESP32, ESP32-S2, and ESP32-C3.
This commit is contained in:
Gregg 2022-02-13 14:39:34 -06:00
parent a4fb99a684
commit 5e72dcbbea
1 changed files with 25 additions and 7 deletions

View File

@ -33,13 +33,31 @@
// IMPORTANT: YOU LIKELY WILL NEED TO CHANGE THE PIN NUMBERS BELOW TO MATCH YOUR SPECIFIC ESP32/S2/C3 BOARD // IMPORTANT: YOU LIKELY WILL NEED TO CHANGE THE PIN NUMBERS BELOW TO MATCH YOUR SPECIFIC ESP32/S2/C3 BOARD
// //
#define NEOPIXEL_RGB_PIN 26 #if defined(CONFIG_IDF_TARGET_ESP32)
#define NEOPIXEL_RGBW_PIN 32
#define DOTSTAR_DATA_PIN 33
#define DOTSTAR_CLOCK_PIN 27
#define NEOPIXEL_PIN 23 // only one pin needed for NeoPixels #define NEOPIXEL_RGB_PIN 26
#define NEOPIXEL_RGBW_PIN 32
#define DOTSTAR_DATA_PIN 33
#define DOTSTAR_CLOCK_PIN 27
#define DEVICE_SUFFIX ""
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define NEOPIXEL_RGB_PIN 17
#define NEOPIXEL_RGBW_PIN 38
#define DOTSTAR_DATA_PIN 3
#define DOTSTAR_CLOCK_PIN 7
#define DEVICE_SUFFIX "-S2"
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#define NEOPIXEL_RGB_PIN 8
#define NEOPIXEL_RGBW_PIN 2
#define DOTSTAR_DATA_PIN 0
#define DOTSTAR_CLOCK_PIN 1
#define DEVICE_SUFFIX "-C3"
#endif
#include "HomeSpan.h" #include "HomeSpan.h"
#include "extras/Pixel.h" // include the HomeSpan Pixel class #include "extras/Pixel.h" // include the HomeSpan Pixel class
@ -155,11 +173,11 @@ void setup() {
Serial.begin(115200); Serial.begin(115200);
homeSpan.begin(Category::Lighting,"Addressable LEDs"); homeSpan.begin(Category::Lighting,"Pixel LEDS" DEVICE_SUFFIX);
new SpanAccessory(); // create Bridge new SpanAccessory(); // create Bridge
new Service::AccessoryInformation(); new Service::AccessoryInformation();
new Characteristic::Name("Addressable LEDs"); new Characteristic::Name("Pixel LEDS" DEVICE_SUFFIX);
new Characteristic::Manufacturer("HomeSpan"); new Characteristic::Manufacturer("HomeSpan");
new Characteristic::SerialNumber("123-ABC"); new Characteristic::SerialNumber("123-ABC");
new Characteristic::Model("Neo/Dot Pixels"); new Characteristic::Model("Neo/Dot Pixels");