C# 使用 System.IO + System.IO.Ports()使用SerialPort类(调试程序):
Skeleton[] skeletons = new Skeleton[0]; //Open Serial.Com SerialPort com; com = new SerialPort(); com.BaudRate = 115200; com.PortName = "COM3"; com.DataBits = 8; com.Open(); while(true) com.WriteLine("asdadadaasd");
在自己电脑相应的串口com3中,插入Arduino 2560.
Arduino内程序:
void draw() { Serial.begin(9600); } void loop() { while(Serial.available) { Serial.read(); } }
时间: 2024-10-11 00:29:00