WS2812B driven by Mega/LINX/LABVIEW/PC

Hi,

I have about 300 LEDs that I want to individually address using a PC. I figured using Mega and FastLED would be the easiest option, but I need a GUI to allow a user to easily visualise and select one or more LEDs to control. I got LabVIEW and LINX to work with the Mega and so I can use that to address about 50 of the 300 LEDs. The problem is Mega and/or LINX can receive 1 integer array from LabVIEW and when I supply too many RGB values, it seems like it can't handle it.. Maybe this is a memory limitation of the Mega?

Is there a better way of doing this with LabVIEW/LINX, or perhaps some other language?

Thanks

Well I suppose it just might depend on how effective your secret code is? :astonished:

You might remove the delays from your code and see if that helps. If not then post it with a schematic, not a frizzy thing.

Maybe this is a memory limitation of the Mega?

A Mega can handle 300 LEDs no problem.

but I need a GUI to allow a user to easily visualise and select one or more LEDs to control.

I would use either Python3 or Processing to supply the GUI, and send the string of data to the Mega for display. It is 300 * 3 or 900 bytes that need to be transferred over the serial port.

Thanks for the responses.

So it looks like a comms error. On the mega I commented out all the code to do with LEDs so none of the FastLED stuff is involved. I simply use LINX to create the serial connection and send the RGB data to the Mega.

I'm running a test with 30 LEDs, and so 90 RGB values. I have probed the LINX VIs which handles the serial connection and it always times out saying only 58 bytes have been read, as opposed to 90. Now suppose I choose to send data for 19 LEDs or 3*19=57 RGB values, when I do this I don't get a timeout. uncommenting the FastLED code turns the first 19 of the 30 LEDs on. but If I then try 20 (60 RGB values) it times out.

I don't think LINX is doing anything special.. it just sends packets and waits for them to be read and if they haven't if tries again a number of times and then times out if the time is > than some user specified timeout time (I've tried 100ms, 1000ms and 10000ms)

It looks like you are overrunning the buffer on the Linux side and missing sending some data. Try checking the status of the TX buffer before you send each byte.

Once you get to turning on the LEDs your mega will turn off interrupts while sending data to the strip. So that if anything is sent during this time on the serial port you will miss some bytes. To get round this then implement a handshake signal so you tell the Linux side when the mega is ready to listen for new data.

I'm using LINX, not Linux. but yes it seems that LINX can only send a certain amount of data over the serial connection so I am trying t define a buffer and send the data with multiple calls

Yes this is what has now worked for me.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.