通过串口连接并通过它发送和接收 [英] connect via serial port and send and receive by it

查看:91
本文介绍了通过串口连接并通过它发送和接收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好

我想通过串口连接和发送/接收数据。我以前没有这样做过。我需要按下按钮(如同),然后通过端口将数据发送到硬件。如果有答案,请将其发送至PC。

我该怎么办?请帮帮我

hi to everyone
i want to connect via serial port and send/receive data. I've not done it before. I need to press on button(like as OK), then send data by port to a hardware. if it has an answer, send it to PC.
how can i do this? please help me

推荐答案

嗯,这取决于你正在使用的编程语言(和库)。无论如何,您可以使用 Google 找到许多示例。例如(假设您正在为 Windows操作系统进行开发):



。 .NET Framework ) - SerialPort类 [ ^ ]。



WINAPI ) - 串行通信 [ ^ ]。
Well, it depends a bit on the programming language (and the libraries) you are using. In any case you may find many examples just using Google. For instance (assuming you are developing for the Windows OS):

(.NET Framework) - SerialPort Class[^].

(WINAPI) - Serial Communications[^].


这篇关于通过串口连接并通过它发送和接收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆