sjhs_unitySerial
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO.Ports; //시리얼 포트를 사용하기 위한 네임스페이스를 설정해준다. public class ArduinoSerial : MonoBehaviour { //시리얼포트 생성. SerialPort(“포트번호”, 통신속도); 통신 속도는 보통 9600을 사용함. //SerialPort sp = new SerialPort(“/dev/tty.usbserial-A602AKQ5”, 9600); SerialPort sp =newSerialPort(“COM3”,9600); //Windows void Start () { sp.Open(); //시리얼 포트 오픈 } void Update () { //시리얼 포트가 열려있으면 … [Read more…]