问题
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?
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.
回答1:
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.
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.
来源:https://stackoverflow.com/questions/22561910/rs232-arduino-issue