ArduSensor Plugin
CYK
$0.0
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
11/03(2023) |
0.0 |
11/07(2024) |
0.0 |
Jump AssetStore
The process can be simplified for people who need USB serial implementation to connect Arduino sensors to their Android devices.This asset doesn't have much to do with the rendering pipeline since it only uses UI elements.ArduSensor Plugin is a Unity plugin that receives sensor values from an Arduino board that communicates serially with Android. This plugin is implemented using Android native code and calls are made from Unity. Applications include temperature, humidity, barometric pressure, gas resistance, altitude, CO2, TVOC and Lux values. And if there is a compatible IMU sensor, it will even detect the IMU value. The IMU is updated at 0.1 second intervals and the remaining sensors are updated at 4 second intervals.How To Use:Import the plugin package and build the demo scene to verify the AAR plugin is being imported correctly. If not, refer to Unity's official documentation* to properly import the plugin. All implementations are written in the UnityProject/Assets/Scripts/AarBridge.cs file. Create a Java instance to communicate with Arduino through Android's Native Methods.Official Unity documentation related to AAR Plugin : https://docs.unity3d.com/kr/2021.3/Manual/AndroidAARPlugins.htmlThis plugin only works when built for the Android platform.This plugin requires Android SDK 29 or higher.The code for implementing USB serial communication in Android is included in the aar plugin.The aar plugin contains library and Android Activity for USB serial connection.It opens the port and retrieves the vendor ID and device ID of the sensor connected to the Arduino.It receives sensor data measured from the device.It implements a method for transmitting the measured sensor data to Unity.In Unity, the measured values from the Arduino sensor are displayed.Corresponding C# scripts are implemented for the methods in the aar plugin. Android Java Object and Android Java Instance have been used.The implementation of the UI connected to this C# script is also included. It can be customized by assigning to button eventsThe asset uses some elements of [usb-serial-for-android.aar], under the MIT License. Please see the Third-Party Notices.txt file in the package for more details