Hello,
I’m trying to use XOD for communication with Unreal Engine via UE4Duino. I have the UE4 side working well enough. I can transmit a receive data with the sample Arduino code provided as the UE4Duino “Hello World”.
Here is an example of the code based communication.
char inChar;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
// Configure LED
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
while(Serial.available()){
inChar=Serial.read();
doStuff();
}
delay (1);
}
void doStuff(){
if (inChar == '1'){
// Turn on LED and send 'hi' message
Serial.println("Arduino Says Hi");
digitalWrite(LED_BUILTIN, HIGH);
} else if (inChar == '0'){
// Turn off LED and send 'bye' message
Serial.println("Arduino Says Bye");
digitalWrite(LED_BUILTIN, LOW);
}
}
My poor coding skills give me a basic understanding of what is happening here. I need to open a Serial port and read or transmit. The closest tutorial I could find was UART communication between two Arduino’s. Not exactly with I’m looking for.
Is seems like “uart-usb” might be close to “Serial.read”
Can anyone give me some hints? I just need a few pointers on how to get data in and out via the USB cable.
Thanks!