I spent hours trying to understand this, but I must be missing the thing:
How to send a Javascript variable from a webpage (hosted on an Arduino Yun) to the running Arduino sketch.
I have a simple webpage with a text input on it, and I want to send its value (Javascript String) to the Arduino sketch, to control a servo motor. I've tried many things with REST, /arduino and /data to use key and values, but nothing worked.
The problem might possibly come from the webpage. How to send Javascript variables to the Arduino sketch?
I couldn't find any answer in the forum, nor on the Arduino Yun official pages.
Phil01:
It may sound trivial, but I'm really stuck on this.
You can contact the sketch by means of "the bridge". On side of the sketch, you would have to include bridge.h and make appropriate calls to the bridge methods in order to receive those variable(s). I know that there are bridge libraries for Python and Lua, which by default are available on the Linino side, you would have to find the equivalent for your JavaScript code or IWCS, push the data down by calling a Python or Lua script with the variable as parameter....