Masz niewłaściwa konfiguracje podłączonego urządzenia albo brak sterowników USB.
Czasami to wina tylko skryptu wgranego. Zmieniaj na różnego typu skrypty.
Z Arduino już dawno zrezygnowałem przez podobne problemy na różnych urządzeniach, a to skrypt ni e działa to ciągle przerywa itp.
Zacznij od sprawdzenia czy dane w skrypcie i konfiguracja typu LED są prawidłowe.
Na twoim miejscu od razu zamienił bym na wemos albo nodemcu i wgrał wLED jako sterownik.
Tego skryptu zwykle używałem :
Możesz spokojnie potem wykasować moje komentarza ( wszytko po // ) jak nie potrzebne by uprościć skrypt po skonfigurowaniu.
Czasami to wina tylko skryptu wgranego. Zmieniaj na różnego typu skrypty.
Z Arduino już dawno zrezygnowałem przez podobne problemy na różnych urządzeniach, a to skrypt ni e działa to ciągle przerywa itp.
Zacznij od sprawdzenia czy dane w skrypcie i konfiguracja typu LED są prawidłowe.
Na twoim miejscu od razu zamienił bym na wemos albo nodemcu i wgrał wLED jako sterownik.
Tego skryptu zwykle używałem :
Możesz spokojnie potem wykasować moje komentarza ( wszytko po // ) jak nie potrzebne by uprościć skrypt po skonfigurowaniu.
#define NUM_LEDS 72 // liczba LED na taśmie
#define DI_PIN 6 // pin, do którego taśma jest podłączona
// #define CLOCK_PIN 13 // pin zegara, tylko dla 4 pinowych pasków
#define start_flashes 1 // sprawdza kolory przy uruchomieniu ( 1 - włączone, 0 - wyłączone )
#define auto_bright 0 // automatyczna regulacja jasności do poziomu oświetlenia zewnętrznego
// ( 1 - włącz jak jest czujnik światła w zestawie, 0 - wyłącz jak brak )
#define max_bright 166 // maksymalna jasność (0 - 255)
#define min_bright 0 // minimalna jasność (0 - 255)
#define bright_constant 500 // kontrast do światła zewnętrznego (0 - 1023)
//im MNIEJ stałej, tym „ostrzejsza” jasność
//----------------------USTAWIENIA -----------------------
int new_bright;
unsigned long bright_timer;
#define serialRate 500000 // szybkość połączenia optymalna 115200, można więcej do 500 000, nawet 1 000 000.
// Jesli jednak migają diody nalezy zmniejszyć w skrypcie i w tunerze ustawienia np na 115200 !
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i; //słowo kodowe Ada do komunikacji
#include <FastLED.h>
CRGB leds[NUM_LEDS];
void setup()
{
FastLED.addLeds<WS2812, DI_PIN, GRB>(leds, NUM_LEDS); // Inicjalizacja paska LED 3 pin
// FastLED.addLeds<APA102, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // Inicjalizacja paska LED 4 pin
// Jeśli nie ma kolorów w kolejności zmieniamy GRB na inną kolejność !
// Podczas uruchamiania miga na czerwono zielono i niebiesko.
// Można wyłączyć w start_flashes na 0
// Możliwe wpisy dla pasków LED
// DotStars // - AKA the APA102
// Neopixel // - aka the WS2812B (also WS2811 / WS2812 / WS2813, also supported in lo - speed mode) - a 3 wire addressable led chipset
// TM1809 // 4 - 3 wire chipset, cheaply available on aliexpress.com
// TM1803 // - 3 wire chipset, sold by radio shack
// UCS1903 //- another 3 wire led chipset, cheap
// GW6205 // - another 3 wire led chipset
// LPD8806 - SPI // based chpiset, very high speed
// WS2801 - SPI // based chipset, cheap and widely available
// SM16716 - SPI // based chipset
// APA102 - SPI // based chipset
// P9813 // - aka Cool Neon's Total Control Lighting
// DMX // - send rgb data out over DMX using arduino DMX libraries
// SmartMatrix // panels - needs the SmartMatrix library - https://github.com/pixelmatix/SmartMatrix
// LPD6803 - SPI // based chpiset, chip CMODE pin must be set to 1 (inside oscillator mode)
// Uncomment/edit one of the following lines for your leds arrangement.
// ## Clockless types ##
// FastLED.addLeds<NEOPIXEL, DI_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
// FastLED.addLeds<SM16703, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1829, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1812, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1803, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1904, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS2903, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812, DI_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2852, DI_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2812B, DI_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<GS1903, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6812, DI_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<SK6822, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA106, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<PL9823, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6822, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2813, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA104, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811_400, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GE8822, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886, DI_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886_8BIT, DI_PIN, RGB>(leds, NUM_LEDS);
// ## Clocked (SPI) types ## dla 4 pin !
// FastLED.addLeds<LPD6803, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<LPD8806, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2801, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2803, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<P9813, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<DOTSTAR, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<APA102, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<SK9822, DI_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
if (start_flashes) {
LEDS.showColor(CRGB(255, 0, 0));
delay(500);
LEDS.showColor(CRGB(0, 255, 0));
delay(500);
LEDS.showColor(CRGB(0, 0, 255));
delay(500);
LEDS.showColor(CRGB(0, 0, 0));
}
Serial.begin(serialRate);
Serial.print("Ada\n");
}
void loop() {
if (auto_bright) {
if (millis() - bright_timer > 100) {
bright_timer = millis();
new_bright = map(analogRead(6), 0, bright_constant, min_bright, max_bright);
new_bright = constrain(new_bright, min_bright, max_bright);
LEDS.setBrightness(new_bright);
}
}
for (i = 0; i < sizeof prefix; ++i) {
waitLoop: while (!Serial.available()) ;;
if (prefix[i] == Serial.read()) continue;
i = 0;
goto waitLoop;
}
while (!Serial.available()) ;;
hi = Serial.read();
while (!Serial.available()) ;;
lo = Serial.read();
while (!Serial.available()) ;;
chk = Serial.read();
if (chk != (hi ^ lo ^ 0x55))
{
i = 0;
goto waitLoop;
}
memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
for (uint8_t i = 0; i < NUM_LEDS; i++) {
byte r, g, b;
// читаем данные для каждого цвета
while (!Serial.available());
r = Serial.read();
while (!Serial.available());
g = Serial.read();
while (!Serial.available());
b = Serial.read();
leds[i].r = r;
leds[i].g = g;
leds[i].b = b;
}
FastLED.show();
}