C# 如何在windows iot中使用usb电缆作为串行端口使用c将arduino uno连接到rasberry pi 3#
这是我正在使用的代码,但我在第行遇到了一个错误C# 如何在windows iot中使用usb电缆作为串行端口使用c将arduino uno连接到rasberry pi 3#,c#,arduino,raspberry-pi,serial-port,windows-iot-core-10,C#,Arduino,Raspberry Pi,Serial Port,Windows Iot Core 10,这是我正在使用的代码,但我在第行遇到了一个错误 using System; using System.IO.Ports; namespace sampleserialport { public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); string[] ports =
using System;
using System.IO.Ports;
namespace sampleserialport
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
string[] ports = SerialPort.GetPortNames();
Console.WriteLine("The following serial ports were found:");
// Display each port name to the console.
foreach(string port in ports)
{
Console.WriteLine(port);
}
Console.ReadLine();
}
}
}
作为
System.PlatformNotSupportedException:'串行端口枚举
当前平台不支持名称。“
System.IO.Ports命名空间中的API无法在Windows IoT Core上工作。中列出了CP2102 USB 2.0到TTL模块串行转换器,您可以参考示例代码。在Arduino GUI中导航到工具->端口,并确保正确设置。
“当前平台不支持串行端口名称枚举”。
string[] ports = SerialPort.GetPortNames();