Im calling Functions on my mindstorms device running a webserver. it listens to numbers im sending e.g. 200 or 900 and drives a certain way. There is also a “motorstatus” url where the current motor position is shown. so calling that IP gives me a text with that number i could use for drawing something or just showing the current pos.
How can i call that url while my motor is running?
IEnumerator WaitForRequest(WWW www) //here i call the number e.g. 300
{
yield return www;
// check for errors
if (www.error == null)
{
// OK
}
else
{
// ERROR
}
}
in start im doing this:
InvokeRepeating("OutputTime", 1f, 1f);
Funktion:
IEnumerator WaitForStatus(WWW www) //call ip + motorstatus - should return numbers between 0 and 900
{
yield return www;
// check for errors
if (www.error == null)
{
textFromWWW = www.text;
Debug.Log(Time.time + " :: " + textFromWWW);
}
else
{
//Debug.Log("WWW Error: " + www.error);
}
}
Or is there a better way of getting a dynamic text from a website.