Australia
Asked — Edited

Controlling PTH Addressable RGB Leds

How can I control Plated Through-Hole (PTH) addressable RGB LEDs using the Script language in Synthiam ARC? The LEDs I plan to use are equipped with a WS2812 control IC, which is widely used for individually addressable RGB LEDs. Could you provide guidance on how to implement control for these LEDs within the ARC environment?

For reference, here is the product link: Tricolour RGB 5mm LED 600-1000mcd Round Diffused.

I am particularly interested in understanding how to set up the communication protocol and any specific commands or functions within ARC that would allow me to manipulate the color and brightness of each LED individually. Any examples or documentation that could assist in this process would be greatly appreciated.


Related Hardware EZ-B v4
Related Control Neopixel Blaster

ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Canada
#1  

To control Plated Through-Hole (PTH) addressable RGB LEDs equipped with a WS2812 control IC using Synthiam ARC, you can use the NeoPixel Robot Skill. The WS2812 LEDs, commonly known as NeoPixels, are popular for their ease of use and vibrant colors. Here's how you can set them up and control them using ARC:

Step-by-Step Guide to Control WS2812 LEDs with ARC

  1. Connect the LEDs:

    • Connect the data input of the first WS2812 LED to one of the digital ports on the EZ-B v4.
    • Ensure that the power and ground connections are properly made. The WS2812 LEDs typically require a 5V power supply.
  2. Add the NeoPixel Robot Skill:

    • Open ARC and load your project.
    • Click on the Project tab and then Add Control.
    • In the Add Control window, search for "NeoPixel" and add the NeoPixel robot skill to your project.
  3. Configure the NeoPixel Skill:

    • Click on the gear icon of the NeoPixel control to open its configuration menu.
    • Set the digital port to which your WS2812 LED data line is connected.
    • Specify the number of LEDs in your strip or array.
  4. Control the LEDs:

    • You can use the NeoPixel control interface to set colors and brightness for each LED.
    • For scripting, you can use JavaScript or Python to send commands to the NeoPixel control.

Example Script to Control WS2812 LEDs

Here's a simple example using JavaScript to set the color of the first LED to red:

// Set the first LED to red
controlCommand("NeoPixel", "SetColor", 0, 255, 0, 0);

// Set the second LED to green
controlCommand("NeoPixel", "SetColor", 1, 0, 255, 0);

// Set the third LED to blue
controlCommand("NeoPixel", "SetColor", 2, 0, 0, 255);

// Update the NeoPixel strip to apply changes
controlCommand("NeoPixel", "Update");

Additional Resources

Feel free to experiment with different colors and patterns by adjusting the RGB values in the script. If you have any further questions or need additional assistance, don't hesitate to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Australia
#2  

@Athena Thanks, this is a good start. Just to clarify the wiring for the 4 pins on the LED. Ground, Power, Digital signal, but what is the fourth pin connected to?

PRO
Canada
#3  

The WS2812 LEDs, commonly known as NeoPixels, typically have three pins: Ground, Power, and Data In. However, if you are referring to a four-pin configuration, it's possible that the fourth pin is either a duplicate ground or power pin, or it might be a Data Out pin for chaining multiple LEDs together. Here's a breakdown of the typical connections:

  1. Ground (GND): Connect this pin to the ground of your power supply and the EZ-B v4.

  2. Power (VCC): Connect this pin to a 5V power supply. Ensure that the power supply can provide enough current for all the LEDs in your strip or array.

  3. Data In (DIN): Connect this pin to the digital port on the EZ-B v4 that you configured in the NeoPixel Robot Skill. This is the pin that receives the control signals.

  4. Data Out (DOUT): If present, this pin is used to connect to the Data In of the next LED in the chain. This allows you to control multiple LEDs in series with a single data line.

If your LED has a fourth pin and it's not labeled, it's a good idea to check the datasheet or product documentation for your specific LED model to confirm its purpose. If you have any further questions or need more assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.