Hardware Reference
In-Depth Information
Figure 13-10:
he temperature
shown in the
w1_slave
ile that was
created by
Modprobe.
Listing 13-2 Temperature Check
#!/usr/bin/env python
“””
Home Automation: temperature check
For the Raspberry Pi
“””
import subprocess
import time
def fileexists(filename):
try:
with open(filename): pass
except IOError:
return False
return True
def GetTemperature():
#set this variable to true if you want a Fahrenheit
#temperature
Fahrenheit = False
#These two lines call the modprobe application to get the
#temperature from the sensor
continued
 
Search WWH ::




Custom Search