当前位置:网站首页>Raspberrypico serial communication
Raspberrypico serial communication
2022-07-25 08:02:00 【K.L.Zous】

from machine import UART,Pin
import time
import _thread
# Set baud rate and serial port number
uart0 = UART(0, baudrate=9600,tx=Pin(0),rx=Pin(1))
LED=machine.Pin(25,machine.Pin.OUT)
# Threads 1 Send other data regularly
def write():
i=0
while True:
i=i+1
msg="w=%d"%(i)
print(msg)
uart0.write(msg)
LED.toggle()
time.sleep(1)
_thread.start_new_thread(write,())
while True:
if uart0.any() == 0:
continue
r = uart0.readline()
print(r)
uart0.write(r)
边栏推荐
- Advanced C language (XII) - dynamic memory management
- 475-82(230、43、78、79、213、198、1143)
- How does MTK change the boot logo?
- [unity introduction program] basic concepts GameObject & components
- 设计一个有getMin功能的栈
- Enq: HW - fault analysis caused by content waiting
- Install homebrew, NVM and verdaccio to build a private NPM warehouse
- 【FFmpeg】mp4转yuv
- New version 8.6 SEO quick release system (can be built at source level)
- UNIPRO multi terminal deployment to meet customers' diversified needs
猜你喜欢

Cerebral cortex: the relationship between lifestyle and brain function in the elderly and its relationship with cognitive decline

How does MTK change the boot logo?

What has become a difficult problem for most people to change careers, so why do many people study software testing?

App power consumption test

Eval and assert one sentence Trojan horse analysis

eval与assert一句话木马分析
![[dynamic programming] - Knapsack model](/img/0d/c467e70457495f130ec217660cbea7.png)
[dynamic programming] - Knapsack model

Didi eta (estimate the travel time)

CAS操作

VS2019 C# MFC安装
随机推荐
Can Flink's current capabilities support the synchronization of a table from source (MySQL) to sink (MySQL) to separate databases and tables
webflux默认io线程数
Learn when playing No 1 | can live classroom still be like this? Come and unlock "new posture"!
Codeforces Round #809 Editorial(A,B,C)
2022-07-19 Daily: too many icml2022 papers to read? "One sentence comments on 1234 paper highlights" helps you quickly lock
Teach you to use cann to convert photos into cartoon style
The two Nobel Prize winners became the chief scientist of the sky high price Baijiu of "taishanglaojun holding a dream"
Technical Analysis | Doris connector combined with Flink CDC to achieve accurate access to MySQL database and table exactly once
Introduction to machine learning (I): understanding maximum likelihood estimation in supervised learning
Oracle trigger creation
Acnet: asymmetric convolution for image hypersegmentation (with implementation code)
Advanced C language (XII) - dynamic memory management
Problems easily ignored by POM
刷题《剑指Offer》day02
How to reverse a stack with recursive functions and stack operations only
App power consumption test
[unity entry program] basic concept trigger
Design a stack with getmin function
7.24模拟赛总结
Network file storage system (II) practical operation of Minio distributed file system