This project is to help set up the basics of communicating between the Unity Game Engine and an Arduino. If you find any issues with the program please create an issue here I will try to respond to any as soon as possible.
Version | Link |
---|---|
2021.2.19f1 | Windows • Mac • Linux |
Board | Supported | Buy | Credit |
---|---|---|---|
Arduino Uno R3 | Yes | store.arduino.cc | @callums005 |
Arduino Mega R3 | Unknown | store.arduino.cc | |
Arduino Leonardo | Unknown | store.arduino.cc | |
Arduino Micro | Unknown | store.arduino.cc | |
Arduino Zero | Unknown | store.arduino.cc | |
Arduino Nano | Unknown | store.arduino.cc | |
Raspberry Pi (All Selection) | No | @callums005 |
File | Link |
---|---|
Unity Main Script | Controller.cs |
Arduino Main Script | Controller.ino |
The program takes advantage of the arduino serialization functionality, it will during the arduino's program lifetime, it will read data using the Serial.readBytes()
functionality, converting it to an array of characters. At the end of each loop it will output any data using the Serial.println()
functionality.
System.IO.Ports
. It will then read in any incoming data to a sepearte string. This is all done on a seperate thread to the main game loop to prevent the game from freezing. The strings are used to send data from the main game thread to the second thread and the other way around.This code is not malicious however I am not responsibe for any damage done to your computer. This code was written on the 15th of June 2022, for the Unity Game Engine version 2021.2.19f1. I will try to fix any issues with later version, please open an issue if you find one or need help, I will try to get back to you as soon as possible. This is a community project therefore you are able to write code or maintain the code if you wish. I have no objegation to maintain this program, however I will try to.