当前位置:网站首页>Some experiences of Arduino soft serial port communication
Some experiences of Arduino soft serial port communication
2022-07-03 07:19:00 【yuchu3d】
1、arduino On the main board RX TX Pin Sometimes not enough , At this time, we need to put others Pin Through software Analog to serial communication pin , But not every pin Can be converted like this , Different boards , Somewhat different .
2、arduino Uno There is only one RX TX Pin , Namely 0 and 1 Pin , These two pins are usually used to communicate with the computer by default ,Serial.begin Serial.print Serial.read This pin is targeted . If arduino Uno Serial communication with other hardware is required , It must be Set soft serial port , Put other pins Used as a serial communication pin . First Will be Contains the corresponding library functions SoftwareSerial.h , then use SoftwareSerial name(rxPin, txPin) To define a soft serial port name, also And use it name.listen(), To monitor this soft serial port . Of course Nor can any pin be used as a serial communication pin ( The pin needs to support interrupt function ).
3、 If the original arduino On my board There is More than one TX RX Pin , Sometimes You can use it directly On the board TX RX Pin . With arduino mega 2560 Come on , Above all Yes RX0 TX0, RX1 TX1,RX2 TX2,RX3 TX3 Four pairs of serial port pins , RX0 TX0 , It communicates with the computer by default , use serial Set up , When communicating with other boards , If it is connected to RX1 TX1 On , We use it serial1 To set up , Empathy Connect to RX2 TX2 On , We use it serial2 To set up , You don't need to use SoftwareSerial To set the soft serial port , Also need not listen() Function to monitor . however If we use other pins such as 10 11 To do serial communication , To use SoftwareSerial name(rxPin, txPin) To set .
边栏推荐
- Discussion on some problems of array
- Pits encountered in the use of El checkbox group
- Advanced API (batch image Download & socket dialog)
- centos php7.2.24升级到php7.3
- GStreamer ffmpeg avdec decoded data flow analysis
- La différence entre le let Typescript et le Var
- Pat grade a real problem 1166
- Liang Ning: 30 lectures on brain map notes for growth thinking
- Wireshark software usage
- 2021 year end summary
猜你喜欢
Common APIs
Specified interval inversion in the linked list
SecureCRT取消Session记录的密码
On the practice of performance optimization and stability guarantee
JMeter test result output
Basic components and intermediate components
Docker builds MySQL: the specified path of version 5.7 cannot be mounted.
Recursion, Fibonacci sequence
Inno Setup 制作安装包
Common problems in io streams
随机推荐
The difference between typescript let and VaR
4EVERLAND:IPFS 上的 Web3 开发者中心,部署了超过 30,000 个 Dapp!
Interview questions about producers and consumers (important)
[solved] win10 cannot find a solution to the local group policy editor
高并发内存池
[plus de détails] dernière entrevue complète redis (50)
PHP install the spool extension
JMeter JSON extractor extracts two parameters at the same time
Laravel frame step pit (I)
《指环王:力量之戒》新剧照 力量之戒铸造者亮相
Laravel Web框架
gstreamer ffmpeg avdec解码数据流向分析
The education of a value investor
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
My 2020 summary "don't love the past, indulge in moving forward"
CentOS switches and installs mysql5.7 and mysql8.0
Architecture notes
【CMake】CMake链接SQLite库
How to plan well?
Sorting, dichotomy