Rs232 arduino 问题 [英] Rs232 arduino issue

查看:45
本文介绍了Rs232 arduino 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 arduino uno 有点困惑.我使用 Serial.print("hi") 代码然后它hi"出现在串行监视器上.我还使用 rs232/ttl 转换器,它们在 arduino 上正确连接了引脚 1 和 0.然后我意识到当 serial.print("hi") 处理数据时首先通过 USB 电缆.但我希望数据必须通过 1 和 0 的 tx rx 引脚.但是当我从串行监视器输入一些数据时,rs232/ttl 会工作并且会发送一些数据?我不明白情况?

I have a little confusing about arduino uno. I use Serial.print("hi") code then it "hi" appears on the serial monitor. I also use rs232/ttl converter which are connected pin 1 and 0 on the arduino properly. Then I realize that when serial.print("hi") working the data first is going through usb cable. But I want the data has to go through tx rx pins which are 1 and 0. But when I enter some data from serial monitor , rs232/ttl will work and some data will be sended ? I do not understand the situation?

为什么会这样?我只想使用 rs232/ttl 转换器从引脚 1 和 0 发送数据.我怎样才能做到这一点 ?我不使用 USB 数据线发送数据.

Why this is happening ? I just want to sent a data from pin 1 and 0 using rs232/ttl converter. How can I do that ? I do not use usb cable to sent datas.

推荐答案

如果您看到数据通过默认 USB 端口传入和传向 PC,那么您使用的是引脚 0 和 1.如果您正确连接外部转换器,您应该能够读取完全相同的内容,否则,连接错误.经典错误是切换 TX 和 RX,因为它们必须交叉.

If you see the data coming from and to your PC by default USB port, then you ARE using pin 0 and 1. If you correctly connect an extenal converster, you should be able to read exactly the same thing, if not, connection are wrong. Classic error is to switch TX and RX, as they have to be crossed.

还要记住,RS232 不支持多主机,但如果其他主机"只是在读取,通常不会有问题,因为它们只会嗅探连接.

Also remeber that RS232 does not support multiple host, but normally give no problem if the "others host" are just reading, as they will simply sniff the connection.

这篇关于Rs232 arduino 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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