当前位置:网站首页>Raspberrypico serial communication
Raspberrypico serial communication
2022-07-28 20:19: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)
边栏推荐
- KubeEdge发布云原生边缘计算威胁模型及安全防护技术白皮书
- 七种轮询介绍(后附实践链接)
- 9. Pointer of C language (4) pointer and one-dimensional array, pointer operation
- Circular linked list OJ question
- 7. Functions of C language, function definitions and the order of function calls, how to declare functions, prime examples, formal parameters and arguments, and how to write a function well
- WUST-CTF2021-re校赛wp
- flask_ Mail source code error
- 1、 Relationship among CPU, memory and hard disk
- Item exception handling in SSM
- A chip company fell in round B
猜你喜欢
![[C language] simulation implementation of strlen (recursive and non recursive)](/img/73/e92fe714515491f1ea366d6924c9ec.png)
[C language] simulation implementation of strlen (recursive and non recursive)

WUST-CTF2021-re校赛wp

C+ + core programming
![[C language] Fibonacci sequence [recursion and iteration]](/img/02/6cff776db583f1b149686e15649d41.png)
[C language] Fibonacci sequence [recursion and iteration]

Storage of C language data in memory (1)

Theoretical knowledge of digital image (I) (personal analysis)

5. Difference between break and continue (easy to understand version)
![[C language] comprehensively analyze the pointer and sort out the pointer knowledge points](/img/71/f4138b68c27d6447fbd5b5e0762929.png)
[C language] comprehensively analyze the pointer and sort out the pointer knowledge points

Cdga | how can the industrial Internet industry do a good job in data governance?

4. Const and difine and the problem of initializing arrays with const and define
随机推荐
C language functions and pointers
Common modules of saltstack
Implementation of strstr in C language
zfoo增加类似于mydog的路由
JVM(二十四) -- 性能监控与调优(五) -- 分析GC日志
熊市下PLATO如何通过Elephant Swap,获得溢价收益?
2. Floating point number, the difference between float and double in C language and how to choose them
基于 MinIO 对象存储保障 Rancher 数据
C language function
[C language] print pattern summary
Saltstack advanced
[C language] scanf format input and modifier summary
河北邯郸:拓展基层就业空间 助力高校毕业生就业
DSACTF7月re
C language - data storage
Tencent cloud deployment lamp_ Experience of building a station
[C language] Fibonacci sequence [recursion and iteration]
9. Pointer of C language (5) how many bytes does the pointer variable occupy
最大交换[贪心思想&单调栈实现]
XOR operation and its usage