How to connect Arduino with Processing.js script in website?

Hello,

I wrote a processing.js script directly into my website.

This script plays music on the web and I want it to interact with the LED lights on my Arduino. How do I go about in doing this?

Is there like a javascript library for the Arduino that I can import in my website for this to work?

Thank you!

I wrote a processing.js script directly into my website.

Say what? Processing does not run javascripts and it does not run "in a website".

Is there like a javascript library for the Arduino that I can import in my website for this to work?

No.

If your javascript can write to the serial port that the Arduino is connected to (very unlikely unless your desktop/laptop is what is hosting the web site), then it could send information to the Arduino, which could do something based on the information.

PaulS: Say what? Processing does not run javascripts and it does not run "in a website".

Processing.js does work when wrote directly into the website. Mine is working and it is playing music on my website, but the problem is that I want it to connect my Arduino at the same time.

On which Arduino do you expect to run this JavaScript programming language?

SurferTim: On which Arduino do you expect to run this JavaScript programming language?

Arduino Uno

You have a java script called Processing.js. That is NOT what you said in your original post. You have not shown that script.

You can NOT run that script on any Arduino.

PaulS: You have a java script called Processing.js. That is NOT what you said in your original post. You have not shown that script.

You can NOT run that script on any Arduino.

I did mention processing.js script.

Please reread my original post:

"I wrote a processing.js script directly into my website."

You also said this:

Is there like a javascript library for the Arduino that I can import in my website for this to work?

The answer is no.

Must to have one proxy(intermediate,relay) like in this sample http://danialk.github.io/blog/2014/04/26/arduino-and-processingjs-and-socketio-in-action/ this is nodeJS proxy based on socket.io but you can create proxy with processing.exe or python.exe(see http server for example) success

Must to have one proxy(intermediate,relay) like in this sample http://danialk.github.io/blog/2014/04/26/arduino-and-processingjs-and-socketio-in-action/ this is nodeJS proxy based on socket.io but you can create proxy with processing.exe or python.exe(see http server for example) success

PS: proxy permit to not acces directly device from internet but can exchanghe results for queries as relay,broker,intermediate,dispatcher... The port must be forwarding or can use ngrok