AaronLiddiment / RGBLEDS

Matrix, Text & Sprite libraries for use with FastLED
68 stars 28 forks source link

WS2811 chipset and Arduino Uno problem #10

Open performanc3 opened 6 years ago

performanc3 commented 6 years ago

Hi Aaron ,

I'm trying to scrolling some words but when i upload the code ; code does not show properly on my matrix . LEDs are working randomly , examples of matrixs are not working same problem. Arduino gnd & supply gnd common by the way , using step down module for Arduino 5v. I suspected of matrix type any do u have any idea ? Where could i have done wrong ?

Thank you for your concern Best Regards,

Matrix Properties : 9hx30w total 270 rgb5050 Matrix Connections: LED_PIN -- resistor-- Din---Do--Din --Do Chipset: Ws2811 12v Data Gnd Supply: 12v 16,5 Amp Smps

Here is sample code :

include

include

include

include

define LED_PIN 6

define COLOR_ORDER GRB

define CHIPSET WS2811

define MATRIX_WIDTH 30

define MATRIX_HEIGHT 9

define MATRIX_TYPE HORIZONTAL_ZIGZAG_MATRIX // There might be a problem ???

cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;

cLEDText ScrollingMsg;

const unsigned char TxtDemo[] = { EFFECT_SCROLL_LEFT "HELP "};

void setup() { FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size()); FastLED.setBrightness(16); FastLED.clear(true); delay(500); FastLED.showColor(CRGB::Red); delay(1000); FastLED.showColor(CRGB::Lime); delay(1000); FastLED.showColor(CRGB::Cyan); delay(1000); FastLED.showColor(CRGB::White); delay(1000); FastLED.show();

ScrollingMsg.SetFont(MatriseFontData); ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0); ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1); ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff); }

void loop() { if (ScrollingMsg.UpdateText() == -1) ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1); else FastLED.show(); delay(10); }

AaronLiddiment commented 6 years ago

In my experience a 12v strip means that you have 1 WS2811 chip for every 3 leds which means all 3 leds will be the same colour. For a Matrix it is better to use WS2812 strips that are single leds with the chip built in. If your strip is 3 leds per chip then you would have to change your width to 10 to get the matrix code to work correctly but each 'pixel' would be 3 leds. The MATRIX_TYPE tells the matrix code how the leds are wired together, a ZIGZAG type is where the strips are connected at alternate ends rather than running wires back from the end of each line to the start of the next.

performanc3 commented 6 years ago

Thank you for your support Aaron codes worked last night but the writings are not very clear because of 3led in 1 pixel. I'll buy WS2812B for next project, i have questions about codes :

  1. Can you explain scrolling text speed routine? How can i change the speed of writing?

  2. What is the role of these :hexadecimals : maybe the answer ; it shows start of addresses of char ? if it's how can i calculate of addresses ?

EFFECT_HSV_AH "\x00\xff\xff\xff\xff\xff" " HSV_AH 00-FF" " " EFFECT_HSV "\x00\xff\xff" "R" EFFECT_HSV "\x20\xff\xff" "A" EFFECT_HSV "\x40\xff\xff" "I" EFFECT_HSV "\x60\xff\xff" "N" EFFECT_HSV "\xe0\xff\xff" "B" EFFECT_HSV "\xc0\xff\xff" "O" EFFECT_HSV "\xa0\xff\xff" "W" EFFECT_HSV "\x80\xff\xff" "S " EFFECT_DELAY_FRAMES "\x00\x96" EFFECT_RGB "\xff\xff\xff"

Best Regards,

AaronLiddiment commented 6 years ago

You should really be using the separate repositories I have uploaded as they are more recent than this combined one and they also have Wiki's with instructions explaining all the functions & commands. https://github.com/AaronLiddiment/LEDMatrix https://github.com/AaronLiddiment/LEDText https://github.com/AaronLiddiment/LEDSprites

To control the speed at different times you can use the EFFECT_FRAME_RATE "\xNN". The NN is a hexadecimal number which is how many calls to Update have to be done before the pixel position is updated.

In all cases the Hexadecimal numbers are the parameters for the EFFECT code. For some there are no parameters but for some there can be up to 6 values.

Have a look at the separated repositories and their Wiki's. Feel free to ask more questions if you are still having problems.

mdaslamknlgit commented 1 year ago

Hi

I have ws2812b horizantal from right starts, and connect to second strip data in to 2nd line and second out connect to 3rd line from right hand

can you tell me which matrix type i have to use

letters is reverse like mirror

Thanks

AaronLiddiment commented 1 year ago

Horizontal_Zigzag and use negative number for width as I think your 0,0 is bottom right.

mdaslamknlgit commented 1 year ago

Hi

Thanks for reply

I did but character is up down display, scroll right totally from end to start displaying

mdaslamknlgit commented 1 year ago

Excellent

Working perfectly thanks

define MATRIX_WIDTH 30

define MATRIX_HEIGHT 8

define MATRIX_TYPE HORIZONTAL_ZIGZAG_MATRIX

cLEDMatrix<-MATRIX_WIDTH, -MATRIX_HEIGHT, MATRIX_TYPE> leds;

Thanks