Skip to content

Instantly share code, notes, and snippets.

@EspaceRaspberryFrancais
Created March 14, 2019 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EspaceRaspberryFrancais/bba349c9f58e2b35ad286be2a36b22e2 to your computer and use it in GitHub Desktop.
Save EspaceRaspberryFrancais/bba349c9f58e2b35ad286be2a36b22e2 to your computer and use it in GitHub Desktop.
import serial
ser = serial.Serial('/dev/ttyXXXX', 9600)
print("CTRL + C pour arrêter")
while True :
led = int(input('Quelle LED souhaitez-vous allumer / eteindre ? (Rouge=1 / Vert=2 / Bleu=3)'))
action = input("Souhaitez-vous allumer ou Eteindre la LED ? (Allumer=1 / Eteindre=0)")
if (action == 1) :
ser.write(str(led))
else :
msg = led+3
ser.write(str(msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment