当前位置:网站首页>Raspberry Pi B的UART极简例程
Raspberry Pi B的UART极简例程
2022-04-22 15:04:00 【Charming Sun】
一、安装WiringPi2-Python
执行以下命令:
sudo apt-get update
sudo apt-get install python-dev python-pip
sudo pip install wiringpi2
二、编辑Python代码
创建如下Serial.py文件,并增加可执行权限:
#!/usr/bin/env python
import wiringpi
wiringpi.wiringPiSetup()
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
wiringpi.serialPuts(serial,'Hello World!')
三、连接硬件并执行程序
按照管脚图接好杜邦线,然后执行Serial.py程序:

本文参考链接:
UART at Raspberry Pi GPIO Pinout
How to install WiringPi2 for Python on the Raspberry Pi
版权声明
本文为[Charming Sun]所创,转载请带上原文链接,感谢
https://blog.csdn.net/CharmingSun/article/details/50880206
边栏推荐
- 【网络】传输层-UDP协议
- Liunx常用命令
- Ruoyi integrates JSP and thymeleaf solutions at the same time
- When our son was 18 years old and went to college, we were already 60. What financial products are the most reliable for him to buy?
- rotate an array by k positions clock-wise
- Saving notes 20: transforming notebook computer (ASUS a555l)
- [interpretation of orb_slam2 source code] Analyze orb_ How is the position and attitude calculated in the first frame of slam2 rgbd
- ROS通信机制二---服务通信
- 【深入理解TcaplusDB技术】将数据插入到列表指定位置接口说明——[List表]
- 爱站网关键词挖掘查询工具-批量网站关键词挖掘导出软件免费下载
猜你喜欢
随机推荐
Introduction to JVM garbage collection serial, serial old, parallel scavenge, parallel old and STW (stop the world)
web自动化测试框架通过js来实现对web元素的操作
带你了解极具弹性的Spark架构的原理
2022茶艺师(中级)考试题及答案
Machine learning model fusion method!
百合医疗IPO被终止:实控人黄凯之父黄维郭曾是佛山副市长
C语言的基本练习(002-1)
关于阿里云OSS资源STS访问控制
记录一个sql,查询用户最后任职的一家公司,并根据企业名称+用户名称进行搜索
leetcode1025. 除数博弈(简单)
Redis optimization series (I) building redis master-slave based on docker
Development trend of C in 2022
微信小程序----第四天
When there is only input and output in flinksql, it will be merged into a subtask. In this case, the amount of input and output data cannot be displayed?
Watch out for spies! Safeguard national security, you and I guard together
Android性能优化 _ 帧动画OOM?优化帧动画之SurfaceView逐帧解析,阿里P8面试官都说太详细了
2022年危险化学品生产单位安全生产管理人员考试题模拟考试平台操作
leetcode746. Climb stairs with minimum cost (simple)
中一科技深交所IPO:市值83亿 湖北诞生又一家上市企业
Redis面试题汇总,mysql索引优化面试题常问

![[Mysql] CHAR_LENGTH函数](/img/1c/57bc70f35429d0add2dbee99e06c1c.png)







