Hi
I’ve managed to get a script to send a stream of single digits from a scene to an Arduino board, so that a different LED lights up for each digit. However, there is a significant delay after the first light, and most of the sequence of lights happens after I close the scene. (Working in Play mode, with the signals being sent from a function called in Update).
Can anyone suggest why there should be such a delay please? If I send a fixed string of digits (eg 01234567) from the Start function, it works fine, it’s only in the Update function that the delay happens.
The following function is called from Update() with the digit to be sent to Arduino as ‘number’. sp is a public Serial Port object that has been opened and seems to work OK; the sp.Write is the command I’m concerned with. (The rest of the function sends information to GUIText just so I can see what’s going on).
public void sendToArduino(string number){
sp.Write(number);
message = "Direction " + number + ", Time " + Time.time;
orientation.SendMessage("ShowMessage", message);
}
PS: I’ve flagged this as code, but it’s lost the layout - is that how it should appear? :0)