Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于Mbed的Python串行通信_Python_Pyserial_Mbed - Fatal编程技术网

基于Mbed的Python串行通信

基于Mbed的Python串行通信,python,pyserial,mbed,Python,Pyserial,Mbed,我有一个使用USB端口和python中的pyserial与raspberry pi通信的设备。当用户在命令行上输入“重置”时,设备将被重置,我应该怎么做 延迟回复,但您需要在设备上创建一些处理程序代码,每当它看到通过串行端口进入reset时调用NVIC\u SystemReset()。您尚未指定“设备”的含义。假设该设备是连接到Raspberry pi的Mbed设备,并且您的Python代码正在Raspberry pi上运行 大多数Mbed设备可以通过在串行接口上发送中断条件来重置。请检查pyS

我有一个使用USB端口和python中的pyserial与raspberry pi通信的设备。当用户在命令行上输入“重置”时,设备将被重置,我应该怎么做

延迟回复,但您需要在设备上创建一些处理程序代码,每当它看到通过串行端口进入
reset
时调用
NVIC\u SystemReset()

您尚未指定“设备”的含义。假设该设备是连接到Raspberry pi的Mbed设备,并且您的Python代码正在Raspberry pi上运行

大多数Mbed设备可以通过在串行接口上发送中断条件来重置。请检查pySerial API以了解这一点

另外,请检查在用于Python2.7和3.x的工具中是如何完成的

import serial
while True:
device = serial.Serial('/dev/ttyACM0')
data = device.readline()
print(data + '\n')