Colorpicking php site

Hello,

I have implemented the WS2812B LEDSTRIP with the neopixel library. I am now creating a php webpage where i want to integrate a javascript colorpicker (this i can do).

Can someone help me how i can send the R,G,B values from the colorpicker php site to my Spark Core.

Thank you for your help

@jerryaertssen, you could convert your RGB value to a string and call a Spark.function() on your Spark with that string value. In the function, you then parse out the RGB and convert them back to integers using atoi() for example. :smile:

3 Likes

Thank you for your reply, that seems to be the correct way to do it.

in order to send the rgb text values to the spark core i can use php right? or do i also need to use Curl (new for me)

How would this line for example can be integrated into a php file:

curl https://api.spark.io/v1/devices/0123456789abcdef01234567/brew
-d access_token=1234123412341234123412341234123412341234
-d “args=coffee”

or can i skip Curl and directly post all the variablbes with a php form

1 Like

You can definitely use PHP. Check out this code that @wgbartley cooked up.

1 Like

I’m not sure if this is remotely what you’re looking for, but it’s sending RGB values to the Core nonetheless. Thought you might be able to use some of it: https://community.spark.io/t/looking-for-step-by-step-tutorial-using-the-cloud/4696/8