擅长:python、mysql、java
<p>这里有一个snipet如何在python中使用serial</p>
<pre><code>s.write(command);
st = ''
initTime = time.time()
while True:
st += s.readline()
if timeout and (time.time() - initTime > t) : return TIMEOUT
if st != ERROR: return OK
else: return ERROR
</code></pre>