UE4Duino - Arduino to UE4 plugin Release!

Hey,

A couple questions:
1)
I’m working on developing a controller from a physical ATV to control a virtual ATV in my game. I have established a serial connection and can view the serial port as open, but after the first burst of data the serial port no longer communicates and I can no longer send data to UE4. I need this in order to control steering, throttle, and braking in the game.

When I do a serial write what should be the corresponding line in my arduino code be to capture the data being sent? I haven’t really experimented with this yet, but I need to send quaternion values back to my arduino to be repackaged as udp packets.

Thanks,

Just wanted to follow up to my own post, I had success last night altering my arduino sketch a little bit. Turns out the lag I was experiencing was due to tringing my LED with a string over Serial. When I had the board listen for a single byte everything worked much better. I thought I’d share the sketch in case anyone else with little experience stumbles across this thread.

I think it’s also worth sharing that I used a Littlebits Ardurino Heart module so everything was really really simple to get going with no prior knowledge.

//

// Simple script to test a single port on a Littlebits Arduino Heart with and LED conected
// to a trigger volume in Unreal 4.

//

const int ledPin = 1; // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into

void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
}

void loop() {
// check for incoming serial data:
if (Serial.available() > 0) {
// read previous byte in the serial buffer:
incomingByte = Serial.read();
// turn on the LED:
if (incomingByte == ‘Y’) {
digitalWrite(ledPin, HIGH);
}
// turn off the LED:
if (incomingByte == ‘N’) {
digitalWrite(ledPin, LOW);
}
}
}

Hi , thank you for this awesome plugin!
I’m trying to map speed values in unreal to analoWrite values. I converted strings to integers, but this method seems to be very slow and unreal crashes very often.
What would be a better/stable method to control values dynamically?
also, I’ve see the fusionlabs example on youtube, where the rotation of the puppet is controlled by a Poti. Could you post the example code?
Any help would be great! :slight_smile:

I Just updated the plugin to support 4.9 UE. Download with the new link, now it includes the source files for the plugin.

Changes made:-

  1. edited file “file_name”
  2. Changed the “Slate.h” header file in “UE4DuinoPCH” to “SlateBasics.h”

Just use the download link below!

://drive.google.com/file/d/0B7hqDvPVJ_50X2ZYUlZnVkhnZGs/view?usp=sharing

Hi Providence,

Thanks again for updating this great plugin. I tried downloading the above link, but it keeps saying that I need to request permission for google drive.

Hi Im sorry.i forgot to change the sharing options.No Worries.I Have changed it now…
i have updated my post.
here you go.
://drive.google.com/file/d/0B7hqDvPVJ_50X2ZYUlZnVkhnZGs/view?usp=sharing

Hi,

will there be a 4.9 release as well ? if not what about 4.8.3 ( the latest 4.8 ) ?

Plugin for 4.9 is currently available.

I Was Wondering About This A While Ago, That’s A New Cool Type Of Plugins!** Thanx For Sharing.**

Hi ,
been using your awesome plugin over 6 months now. Made a steering wheel set up and now onto making a model smart home but I’m still trying to work out how to use the serial write. What does it tell arduino/ where does it go out? There is like nothing covering that atm. Srry if I’m not getting it though.
Thanks,

Has anyone been able to build a project with this plugin? Every version that comes out I try to do a build and every time I get no errors on build but when I open my exe file I get UE4Duino could not be found please consider building without plugin. Is there something I’m missing to building with this? Thanks!

Freakin Amazing!!!

Hi so I finished this for a University project I’ll link you the blog where we finished our work. Though I’d appreciate if you didn’t send it as a private message and keep on the forums so other people can see this. Note of warning though as it wasn’t fully finished just the wheel and it was done with the steering not fully completed but should give you an idea of what we did. Not sure about some of your issues, you need to be a bit more in depth like which arduino were you using, hows your arduino code, blueprint setup etc. Good luck

http:///

In regards to my above post:

I took the executable off of the “Event Tick” Boolean, and switched it to the “InputAxis MoveForward” Boolean, and it’s working great now. Video below shows one of my co-workers using the ATV as a controller for UE4. YOu can see the screen in the background has him navigating a course.

I’m using that sketch and blueprint with the latest UE4Duino version 1.9 with the unreal version 1.9.1
The writing to arduino to turn on the led is working fine, but the reading still isn’t working.
Has someone found a solution for that read problem yet? I’d like to use this for my school project.

Hey all! Have to apologize again that I have been out of touch for so long!

First off, want to say a big thanks a ton to Providence94 for updating the plugin to 4.9! Awesomesauce!

@ - Very cool with the ATV setup!!

@jeremycouillard - I have been trying to get the plugin to package correctly, but haven’t had success yet. Right now I can get it to package without errors, but when I try to run the game exe it doesn’t do anything…I double click on it and it just sits there. I will keep looking into it and let you know if I get it to work. Anyone out there manage to package a working game with the plugin?

@Lozoo501 - I tried your setup from the images and everything seemed to work ok for me…the light went on and off and I had the SerialRead showing the two text messages on screen. What do you have showing up when you run it?

By the way, if you could figure out how to get support for Android I would be eternally grateful. I’m trying to make an Android app to control an Arduino project, and currently I could do it with Unity, but both Unity 4 and Unity 5 have baked lighting issues on mobile while everything looks amazing and perfect on UE4, only downside is no Arduino support for Android with UE4.

I am in need of UE4duino plugin that is compatible with engine version 4.9.
This link doesn’t seem to work.
://drive.google.com/file/d/0B7h…ew?usp=sharing
Please help.


String input;

void setup()
{
	Serial.begin(9600);
	pinMode(13, OUTPUT);
	digitalWrite(13, LOW);
}

void loop()
{
	//Serial.println("Wazzaaaahhh");
	//delay(2000);
	//digitalWrite(13, LOW);
	//delay(2000);
	//digitalWrite(13, HIGH);

	if (Serial.available() > 0)
	{
		input = Serial.readString();
		if (input == "ON")
		{
			digitalWrite(13, HIGH);
			Serial.println("TURNED ON");
		}
		else if (input == "OFF")
		{
			digitalWrite(13, LOW);
			Serial.println("TURNED OFF");
		}
	}

	//Serial.println(2);
}

I’m getting a compiler error now, while I don’t remember getting that last time although, I can still play the game with the same effect (and problem) as before. The error says something about an array I guess? But I don’t have any code besides the blueprint that I’ve shown which doesn’t include one (kinda odd unless it has something to do with the plugin).

It’s just not picking up the Serial.println() for some reason… I’ve tried changing the baud rate and putting the println method on different places, but it just isn’t doing anything in unreal… although it works fine in the serial monitor (and no I didn’t have it open when trying in unreal).

@madhu27 - Sorry about that…I copied the link incorrectly…

Try the link in the first post again…should be good now :slight_smile: