64
edits
Line 47: | Line 47: | ||
A test was done, in which the pulse data collected from person is used to control the angle of blocks in Unity. | A test was done, in which the pulse data collected from person is used to control the angle of blocks in Unity. | ||
[https://www.youtube.com/watch?v=RbPW2_f4YVk| Test video:Use pulse sensor in unity3D ]<br> | [https://www.youtube.com/watch?v=RbPW2_f4YVk| Test video:Use pulse sensor in unity3D ]<br> | ||
[[File:connect pulse sensor with Unity.png|left| | [[File:connect pulse sensor with Unity.png|left|220px|]] | ||
———Unity | ———Unity script——————————————————————————<br> | ||
using System.Collections;<br> | using System.Collections;<br> | ||
using System.Collections.Generic;<br> | using System.Collections.Generic;<br> | ||
Line 61: | Line 61: | ||
serial.Open ();<br> | serial.Open ();<br> | ||
int rotation = int.Parse (serial.ReadLine ());<br> | int rotation = int.Parse (serial.ReadLine ());<br> | ||
transform.localEulerAngles = new Vector3(0, rotation, | transform.localEulerAngles = new Vector3(0, rotation,0);}}<br> | ||
0);}}<br> | ———Unity script——————————————————————————<br> | ||
———Unity | |||
edits