You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Looks like there's an incompatibility between LXSAMD21DMX and Adafruit_NeoPixel on Seeed Xiao Samd21.
They're both independently working but together, LXSAMD21DMX is not able to get slot values. DMX messages are received, but all slot values are stuck to 0 as soon as there's a call to strip.show(). (if you comment the strip.show() line, values are correctly received)
Could it be they're using the same timer?
Code used:
#include <LXSAMD21DMX.h>
#include <Adafruit_NeoPixel.h>
#define DMX_INPUT_PIN D3
#define LED_PIN A1
#define LED_COUNT 53
// NeoPixel brightness, 0 (min) to 255 (max)
#define BRIGHTNESS 50 // Set BRIGHTNESS to about 1/5 (max = 255)
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_RGBW + NEO_KHZ800);
// Argument 1 = Number of pixels in NeoPixel strip
// Argument 2 = Arduino pin number (most are valid)
// Argument 3 = Pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
int got_dmx = 0;
void setup() {
Serial.begin(115200);
Serial.println("Hello!");
strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(BRIGHTNESS);
strip.setPixelColor(0,strip.Color(100,100,100,100)); // just to check Neopixel is ok
strip.show();
SAMD21DMX.setDataReceivedCallback(&gotDMXCallback);
SAMD21DMX.startInput();
}
// ***************** input callback function *************
void gotDMXCallback(int slots) {
got_dmx = slots;
}
void loop() {
if (got_dmx){
for (int i=0;i<LED_COUNT;i++){
int startid=i*4+1;
strip.setPixelColor(i, strip.Color(SAMD21DMX.getSlot(startid), SAMD21DMX.getSlot(startid+1), SAMD21DMX.getSlot(startid+2), SAMD21DMX.getSlot(startid+3)));
}
strip.show();
Serial.println(SAMD21DMX.getSlot(1));
got_dmx = 0;
}
}
The text was updated successfully, but these errors were encountered:
Hi,
Looks like there's an incompatibility between LXSAMD21DMX and Adafruit_NeoPixel on Seeed Xiao Samd21.
They're both independently working but together, LXSAMD21DMX is not able to get slot values. DMX messages are received, but all slot values are stuck to 0 as soon as there's a call to strip.show(). (if you comment the strip.show() line, values are correctly received)
Could it be they're using the same timer?
Code used:
The text was updated successfully, but these errors were encountered: