Advertisement
Guest User

Untitled

a guest
Oct 9th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import serial
  2. import time
  3. import requests
  4. import os
  5. arduino = serial.Serial('/dev/ttyUSB0', 9600)
  6.  
  7. os.system('cls' if os.name == 'nt' else 'clear')
  8. while 1:
  9. valores = arduino.readline()
  10. valores = str(valores)
  11. VALUE_SERIAL = valores.split(";")
  12.  
  13. A = (VALUE_SERIAL[0])
  14. B = VALUE_SERIAL[1]
  15. C = VALUE_SERIAL[2]
  16. D = VALUE_SERIAL[3]
  17. E = VALUE_SERIAL[4]
  18. F = VALUE_SERIAL[5]
  19.  
  20. timeout = 10
  21.  
  22.  
  23. B1 = requests.get("https://script.google.com/macros/s/AKfycbzgDF4Cw1NbqwtVeDw8sceywuMQW3gMxuePX33IR4O5AUPVKogR/exec?Axy="+str(D))
  24. C1 = requests.get("https://script.google.com/macros/s/AKfycbzgDF4Cw1NbqwtVeDw8sceywuMQW3gMxuePX33IR4O5AUPVKogR/exec?Bxy="+str(E))
  25.  
  26. time.sleep(10)
  27. os.system('cls' if os.name == 'nt' else 'clear')#Limpa a tela do console
  28. pass
  29. print ('\nValor de A: %s' % (D))
  30. print ('\nValor de B: %s' % (E))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement