当前位置:网站首页>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 .
边栏推荐
- 【最详细】最新最全Redis面试大全(50道)
- [cmake] cmake link SQLite Library
- Warehouse database fields_ Summary of SQL problems in kingbase8 migration of Jincang database
- Use of framework
- php安装swoole扩展
- [untitled]
- How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
- 691. Cube IV
- centos php7.3安装redis扩展
- MySQL mistakenly deleted the root account and failed to log in
猜你喜欢

7.2 brush two questions

Interview questions about producers and consumers (important)

Deep learning parameter initialization (I) Xavier initialization with code

C code production YUV420 planar format file

Docker builds MySQL: the specified path of version 5.7 cannot be mounted.
![PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef](/img/65/1f28071fc15e76abb37f1b128e1d90.jpg)
PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef

Use the jvisualvm tool ----- tocmat to start JMX monitoring
![Gridome + strapi + vercel + PM2 deployment case of [static site (3)]](/img/65/8d79998e96a2c74ba6e237bee652c6.jpg)
Gridome + strapi + vercel + PM2 deployment case of [static site (3)]

Basic components and intermediate components

Store WordPress media content on 4everland to complete decentralized storage
随机推荐
[solved] sqlexception: invalid value for getint() - 'Tian Peng‘
Store WordPress media content on 4everland to complete decentralized storage
SecureCRT取消Session记录的密码
[vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
Win 10 find the port and close the port
Specified interval inversion in the linked list
树莓派更新工具链
Advanced API (use of file class)
gstreamer ffmpeg avdec解码数据流向分析
[most detailed] latest and complete redis interview book (50)
3311. 最长算术
带你全流程,全方位的了解属于测试的软件事故
CentOS php7.3 installing redis extensions
TypeScript let与var的区别
C WinForm framework
Recursion, Fibonacci sequence
Arduino Serial系列函数 有关print read 的总结
centos php7.3安装redis扩展
Interview questions about producers and consumers (important)
Upgrade CentOS php7.2.24 to php7.3