Python Forum
Control NeoPixel LED Strip connected to an Arduino from a RPI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control NeoPixel LED Strip connected to an Arduino from a RPI
#1
Hello,

I have a NeoPixel LED Stripe WS2812 connected to an Arduino, and I would like to control the LED stripe from my RPI via pyFirmata. The RPI connects to the Arduino via a USB cable.

There is an adopted standardfirmata but I could not find an example code for python.

https://github.com/ajfisher/node-pixel

Can I get some help/examples to run this from python? Or do you have any other method/recommendation?
Reply
#2
The code presented here is not the package that you have been using, but is for an arduino clone (which I have used, and code is identical for genuine arduino).
It has quite a large library of examples.
If nothing else, it should help you with your code.
https://github.com/kitesurfer1404/WS2812...fx_overlay

Here's a datasheet that may also help.
Reply
#3
HI @Larz60+

Thanks for your reply - the code you are referring to is firmware that runs on the Arduino to control the WS2812 directly (similar to strand test, etc.)

I am looking for a python code that runs on the Raspberry Py and triggers the Arduino remote to switch on the neo pixel. Ideally, this would be an adopted standardfirmata for the Arduino and a python code for the RPI, that triggers the NeoPixel functions on the Arduino.
Reply
#4
The .ino file is actualy 'C' code (can be listed). I write both 'C' and python, so would be able to use as a guide.

Perhaps a better link would be here (it's loaded with advertisements, but code is there)
youtube video
Reply
#5
[Image: RPI-Arduino-NeoPixel-Schema.png]

I hope with the picture, I can better show/describe the issue. I do not have a problem running the LED stripe from the RPI or the Arduino directly. There are many examples on the internet for this purpose.

In my case, I have an RPI connected to an Arduino via USB. On the RPI, I have run a python program that triggers my ports on the Arduino via the Standardfirmata Library via USB. That works well for a Pengulin PWM, and Relais that are connected to the Arduino.

Where I need support is to have a python sample program showing how to "remote" run the NeoPixel Library on the Arduino out of the Raspberry Pi

The examples shown here are only .JS and I have no idea how to convert it to python
https://github.com/ajfisher/node-pixel/t...r/examples
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020