아두이노랑 Serial 입력하는 방법
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
namespace Serial
{
class Program
{
static void Main(string[] args)
{
SerialPort ObjSerial = new SerialPort();
ObjSerial.PortName = "COM3";
ObjSerial.BaudRate = 9600;
ObjSerial.DataBits = 8;
ObjSerial.Parity = Parity.None;
ObjSerial.StopBits = StopBits.One;
ObjSerial.Open();
ObjSerial.Write("5");
ObjSerial.Close();
}
}
}
Serial.Read(); 로 5 들어오는 거랑 똑같이 동작
'공부,일 > 아두이노' 카테고리의 다른 글
아두이노 통신 (0) | 2021.07.19 |
---|---|
조이스틱 (0) | 2021.07.19 |
초음파 센서 (0) | 2021.07.19 |
아두이노 회로 실습 (1) (0) | 2021.07.16 |
아두이노 회로 실습 (by fritzing ) (0) | 2021.07.15 |
댓글