Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import serial
  2. import matplotlib.pyplot as plot
  3. from drawnow import *
  4.  
  5. L1=[]
  6. L2=[]
  7. L3=[]
  8. temp =[]
  9. hum =[]
  10.  
  11. serialArduino = serial.Serial('com10',9600)
  12.  
  13. def plotValues():
  14. plt.title('Grafic senzor DHT11')
  15. plt.grid(True)
  16. plt.ylabel('Valoare')
  17. plt.plot(temp, 'ro-', label='Senzor temperatura='+valueRead+'L1='+L1+' L2='+L2,color = 'red', hum, 'bo-',label='Senzor humiditate='+valueRead+'L1='+L1+' L2='+L2,color = 'blue')
  18. plt.legend(loc ='upper left')
  19. plt.xlabel('Timp')
  20. plt.ylabel('Temperatura si Umiditatea')
  21.  
  22. for i in range(0,40):
  23. values.append(0)
  24.  
  25. while True:
  26. while (serialArduino.inWaiting()==0):
  27. pass
  28. valueRead,L1,L2,L3 =
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement