擅长:python、mysql、java
<p>最后我发现请替换这些代码行</p>
<p>步骤->;读取、解码为字符串、带/n和/r、转换为浮点
请检查这里<a href="https://problemsolvingwithpython.com/11-Python-and-External-Hardware/11.04-Reading-a-Sensor-with-Python/" rel="nofollow noreferrer">https://problemsolvingwithpython.com/11-Python-and-External-Hardware/11.04-Reading-a-Sensor-with-Python/</a></p>
<pre><code>Value_from_arduino = ser.readline()
Value_from_arduino = Value_from_arduino.decode()
Value_from_arduino = Value_from_arduino.rstrip()
Zustand = float(Value_from_arduino)
</code></pre>
<p>希望这能奏效</p>