Skip to content

Instantly share code, notes, and snippets.

@tombrad
Created July 27, 2017 09:08
Show Gist options
  • Save tombrad/f4d319d38b185364f1fc578cc9a84c56 to your computer and use it in GitHub Desktop.
Save tombrad/f4d319d38b185364f1fc578cc9a84c56 to your computer and use it in GitHub Desktop.
import serial
arduino = serial.Serial('/dev/ttyACM0',9600)
while True:
comando = raw_input('Introduce un comando: ')
arduino.write(comando)
if comando == 'H':
print('LED ENCENDIDO')
elif comando == 'L':
print('LED APAGADO')
arduino.close()#FINALIZA LA COMUNICACION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment