Mango HTML & Javascript Web Interface (7/20/2015)

Today I continued working on the issue of assigning the sensor value to a unique JavaScript element.
In order to overcome this, I tried to return the sensor value as the output of the function, so that I can simply call the same function with different input parameters, and it will return the appropriate outputs.
I start by returning my variable QuerrySensorValue inside the mangoRest function:
I then call the function as the input of the document.getElementById, in order to pipe it to wherever I want.
However, It returns undefined.
I tired adding 500 to the value, to check if it is really a float, and it worked.
This means that the problem is not in accessing the variable internally, but in accessing it externally.
I also created a temporary function called value() that returns a float, so that I could check if amcharts takes it in as output.
This worked, so my approach of returning a value in a function is possible.
I then tried to return the output of the mangoRest function, while also returning the output of the currentValue function, in order to get the original value that is created internally.
However, this results in an object object error.
this means that the internal return that I wrote does not register.
Presumably, returning currentValue.value does not work.

Comments