Last active
February 12, 2016 17:05
-
-
Save thisMagpie/ebac0df74ce827d66125 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/" | |
time = [datetime.datetime.now()] | |
temp = [tmp0.getCelsius()] | |
pylab.ion() | |
pylab.xlabel('Time h:m:s') | |
pylab.ylabel('Temperature C') | |
pylab.title('Temperature vs Time') | |
pylab.ylim(temp[0] - 5.,temp[0] + 5.0) | |
while True: | |
time.append(datetime.datetime.now()) | |
temp.append(tmp0.getCelsius()) | |
pylab.plot(time, temp) | |
pylab.draw() | |
pylab.clf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment