Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

WS2812 python2 support
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

WS2812 python2 support

by bat4arang on Fri Apr 30, 2021 9:58 am

Hi,
We have ROS system installed - the whole ecosystem is based on python2.
The only missing piece is how to integrate ws2812 LED ring that requires python3.
At this point, we don't have an option to upgrade the system.
Is there a way to make them to interwork?
Or is there a python2-based library we can use to work with the ws2812?

Thank you!
Steve

bat4arang
 
Posts: 2
Joined: Fri Apr 30, 2021 9:52 am

Re: WS2812 python2 support

by danhalbert on Mon May 03, 2021 8:54 pm

You can run another program from Python 2 using os.system() or the subprocess module. Since that can be an arbitrary program, assuming you also have Python 3 installed, you could write a Python 3 program to run the WS2812's.

danhalbert
 
Posts: 2376
Joined: Tue Aug 08, 2017 12:37 pm

Re: WS2812 python2 support

by bat4arang on Wed May 05, 2021 3:24 am

danhalbert wrote:You can run another program from Python 2 using os.system() or the subprocess module. Since that can be an arbitrary program, assuming you also have Python 3 installed, you could write a Python 3 program to run the WS2812's.


Excellent idea, Dan. Thanks, we'll give it a shot.

Thanks a lot!

Steve

bat4arang
 
Posts: 2
Joined: Fri Apr 30, 2021 9:52 am

Please be positive and constructive with your questions and comments.