当前位置:网站首页>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 .
边栏推荐
- Sorting out the core ideas of the pyramid principle
- Advanced API (character stream & net for beginners)
- When MySQL inserts Chinese into the database, there is a diamond question mark garbled code
- Book recommendation~
- MySQL mistakenly deleted the root account and failed to log in
- 【已解决】SQLException: Invalid value for getInt() - ‘田鹏‘
- centos php7.2.24升级到php7.3
- [plus de détails] dernière entrevue complète redis (50)
- Mise en place d'un environnement de développement de fonctions personnalisées
- Docker builds MySQL: the specified path of version 5.7 cannot be mounted.
猜你喜欢
![[set theory] partition (partition | partition example | partition and equivalence relationship)](/img/f0/c3c82de52d563f3b81d731ba74e3a2.jpg)
[set theory] partition (partition | partition example | partition and equivalence relationship)

Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record

Wireshark software usage

多个全局异常处理类,怎么规定执行顺序

dataworks自定义函数开发环境搭建

Interview questions about producers and consumers (important)
![[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet](/img/9d/42dfef67246740f0dba0c6d8f1b625.jpg)
[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet

How to specify the execution order for multiple global exception handling classes

My 2020 summary "don't love the past, indulge in moving forward"
![[solved] unknown error 1146](/img/f1/b8dd3ca8359ac9eb19e1911bd3790a.png)
[solved] unknown error 1146
随机推荐
《指环王:力量之戒》新剧照 力量之戒铸造者亮相
Book recommendation~
How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
Strategy mode
Operation and maintenance technical support personnel have hardware maintenance experience in Hong Kong
【已解决】SQLException: Invalid value for getInt() - ‘田鹏‘
The underlying mechanism of advertising on websites
TCP cumulative acknowledgement and window value update
Distributed transactions
Jeecg menu path display problem
[most detailed] latest and complete redis interview book (50)
Specified interval inversion in the linked list
多个全局异常处理类,怎么规定执行顺序
SharePoint modification usage analysis report is more than 30 days
MySQL transaction rollback, error points record
Use the jvisualvm tool ----- tocmat to start JMX monitoring
Use of framework
Jeecg request URL signature
3311. 最长算术
POI excel percentage