I'm trying to get the example code for the NeoPixel on a FireBeetle ESP32 (FireBeetle ESP32 IoT Microcontroller with 250+ ESP32 Tutorials (Supports Wi-Fi & Bluetooth) - DFRobot) though there's an error within the Adafruit_NeoPixel\esp.c. I'm not sure how to address this error or what else to do to control the NeoPixel Strip (Adafruit NeoPixel LED Strip with 3-pin JST PH 2mm Connector [60 LED/meter / 0.5 Meter] : ID 3919 : Adafruit Industries, Unique & fun DIY electronics and kits)
Example Code with 30 pixel strip
/*
* This ESP32 code is created by esp32io.com
*
* This ESP32 code is released in the public domain
*
* For more detail (instruction and wiring diagram), visit https://esp32io.com/tutorials/esp32-neopixel-led-strip
*/
#include <Adafruit_NeoPixel.h>
#define PIN_NEO_PIXEL 6
#define NUM_PIXELS 30 // The number of LEDs (pixels) on NeoPixel LED strip
Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);
void setup() {
NeoPixel.begin(); // initialize NeoPixel strip object (REQUIRED)
}
void loop() {
NeoPixel.clear(); // set all pixel colors to 'off'. It only takes effect if pixels.show() is called
// turn pixels to green one-by-one with delay between each pixel
for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel
NeoPixel.setPixelColor(pixel, NeoPixel.Color(0, 255, 0)); // it only takes effect if pixels.show() is called
NeoPixel.show(); // update to the NeoPixel Led Strip
delay(500); // 500ms pause between each pixel
}
// turn off all pixels for two seconds
NeoPixel.clear();
NeoPixel.show(); // update to the NeoPixel Led Strip
delay(2000); // 2 seconds off time
// turn on all pixels to red at the same time for two seconds
for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel
NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0)); // it only takes effect if pixels.show() is called
}
NeoPixel.show(); // update to the NeoPixel Led Strip
delay(1000); // 1 second on time
// turn off all pixels for one seconds
NeoPixel.clear();
NeoPixel.show(); // update to the NeoPixel Led Strip
delay(1000); // 1 second off time
}
Error Message:
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c: In function 'espShow':
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:184:26: error: 'REF_CLK_FREQ' undeclared (first use in this function)
counter_clk_hz = REF_CLK_FREQ / (div);
^
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:184:26: note: each undeclared identifier is reported only once for each function it appears in
c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:212:5: error: too many arguments to function 'rmt_wait_tx_done'
rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100));
^
In file included from c:\Users\Jared\OneDrive\Documents\Arduino\libraries\Adafruit_NeoPixel\esp.c:71:0:
C:\Users\Jared\AppData\Local\Arduino15\packages\esp32\hardware\DFRobot_FireBeetle-ESP32\0.0.6/tools/sdk/include/driver/driver/rmt.h:684:11: note: declared here
esp_err_t rmt_wait_tx_done(rmt_channel_t channel);
^
exit status 1
Compilation error: exit status 1