You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.
Hi there! first of all... thanks for being so awesome!! your code works like a charm without fps drop :)
I am working on an Arduino Uno, under Windows 10 and Unity 2018.1.0f2 (64 bits).
There is a problem with the .send(message) method, it is easy to replicate:
open the scene WRMHLwrite and replace the loop method on the default arduino code on the ARDUINO.ino file with this code:
// Run forever
void loop() {
sendData("Hello World!");
if (Serial.available() > 0) {
// int input = Serial.parseInt();
}
delay(20); // Choose your delay having in mind your ReadTimeout in Unity3D
}
This works OK, as the RX yellow light blinks when you play your unity game (unity is sending data from the update). But when you uncomment the line
int input = Serial.parseInt();
strange things begin to happen: when you play your game, both RX and TX lights blink once, and then the RX light turns off... the arduino stops receiving data!! also, weird things begin to happen with the data the arduino sends, and the serial port gets locked, not allowing you to upload new code to the arduino o.O (even when you stop your game on unity! o__O).
however, if you substitute that line for:
int input = Serial.read();
everything works just fine :)
I can't figure out where the error is on the code, but i'll keep searching, if I find something, i'll submit a pull request, but by now, I'll just leave this issue open over here...
sorry for my bad english :(
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there! first of all... thanks for being so awesome!! your code works like a charm without fps drop :)
I am working on an Arduino Uno, under Windows 10 and Unity 2018.1.0f2 (64 bits).
There is a problem with the
.send(message)
method, it is easy to replicate:open the scene WRMHLwrite and replace the loop method on the default arduino code on the ARDUINO.ino file with this code:
This works OK, as the RX yellow light blinks when you play your unity game (unity is sending data from the update). But when you uncomment the line
strange things begin to happen: when you play your game, both RX and TX lights blink once, and then the RX light turns off... the arduino stops receiving data!! also, weird things begin to happen with the data the arduino sends, and the serial port gets locked, not allowing you to upload new code to the arduino o.O (even when you stop your game on unity! o__O).
however, if you substitute that line for:
everything works just fine :)
I can't figure out where the error is on the code, but i'll keep searching, if I find something, i'll submit a pull request, but by now, I'll just leave this issue open over here...
sorry for my bad english :(
The text was updated successfully, but these errors were encountered: