1

I've followed Adafruit's instructions on getting WS2811 LEDs up and running using Python, and it's all good.

I've also created a very simple HTML / JS / CSS page which allows the user to 'colour-in' pixels on screen. I want to run this on a Raspberry Pi with the LEDs connected (each on-screen 'pixel' corresponds to an LED). I had hoped to find some PHP which could accept an argument such as LED=42,colour=red which I could use, but no such luck.

I could call a Python script directly and pass arguments to it every time a 'pixel' is clicked, but it's not very elegant.

Does anyone have any ideas of how I could accomplish this, please?

wibbleface
  • 119
  • 14

1 Answers1

1

Not sure how your colouring in works, if it is in a form, you could try using flask. This runs the web server on the raspberry pi. Then, when the web user submits the form, it can be put into a variable in the python script.

Have a look here

Giddy Raccoon
  • 21
  • 1
  • 3
  • First of all: thanks for answering the question! While a link is better than no answer, it would be pretty helpful if you would post a complete answer here and explain the context! – creyD Oct 28 '20 at 19:14