Created
February 11, 2016 16:18
-
-
Save thisMagpie/83ee82104d74d5cdba9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webiopi.devices.sensor import DS18S20 | |
import datetime | |
import pylab | |
tmp0 = DS18S20(slave="10-000802de0ee7") # sensor found with "ls /sys/bus/w1/devices/" | |
N = 50 | |
x = [0.0]*N | |
y = [0.0]*N | |
for i in range(N): | |
x[i] = datetime.datetime.now() | |
y[i] = tmp0.getCelsius() | |
pylab.plot(x, y) | |
pylab.xlabel('Time') | |
pylab.ylabel('Temperature') | |
pylab.title('Temperature vs Time') | |
pylab.grid(True) | |
pylab.savefig("tempvstime_noninteractive.pdf") | |
pylab.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment