Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import serial
  2.  
  3. ser = serial.Serial('/dev/ttyXXXX', 9600)
  4. print("CTRL + C pour arrêter")
  5.  
  6. while True :
  7. led = int(input('Quelle LED souhaitez-vous allumer / eteindre ? (Rouge=1 / Vert=2 / Bleu=3)'))
  8. action = input("Souhaitez-vous allumer ou Eteindre la LED ? (Allumer=1 / Eteindre=0)")
  9. if (action == 1) :
  10. ser.write(str(led))
  11. else :
  12. msg = led+3
  13. ser.write(str(msg))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement