I use AP wifi on esp8266 and adafruit_neopixel to control 300 ws2812 leds with high frequency. after each show() function I use delay(1). Unfortunately, the system ran 15s then the wifi died. But i use delay(10) after show(),it works ok.
This is my code:
Code: Select all
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#define PIN D5
#define NUMPIXELS 300
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define APSSID "TestWIFI"
#define APPSK "12345678"
/* Set these to your desired credentials. */
const char *ssid = APSSID;
const char *password = APPSK;
void setup() {
WiFi.softAP(ssid, password);
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
for(int i=0; i<NUMPIXELS; i++) { // For each pixel...
pixels.setPixelColor(i, pixels.Color(0, 150, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(1); // Pause before next pass through loop
}
}