擅长:python、mysql、java
<p>我也遇到过同样的问题,包括1020字节的缓冲区大小,但还没有找到改变的方法。我的解决方案是实现如下循环:</p>
<pre><code>in_buff=''
while mbed.inWaiting():
in_buff+=mbed.read(mbed.inWaiting()) #read the contents of the buffer
time.sleep(0.11) #depending on your hardware, it can take time to refill the buffer
</code></pre>
<p>如果有人能想出缓冲区大小的解决方案,我会非常高兴!</p>