Skip to content

Instantly share code, notes, and snippets.

@jurandysoares
Created November 1, 2016 11:41
Show Gist options
  • Save jurandysoares/255ea141768e5aa1d9493a4aefadaa87 to your computer and use it in GitHub Desktop.
Save jurandysoares/255ea141768e5aa1d9493a4aefadaa87 to your computer and use it in GitHub Desktop.
Ler dados do Arduino com Python
#!/usr/bin/env python
import sys
from select import select
arq_saida = open('/tmp/saida-arduino.txt', 'w')
i = 1000
with open("/dev/ttyACM0") as f:
while i > 0:
select([f], [], [])
content = f.read()
arq_saida.write(content)
i -= 1
arq_saida.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment