Temperature Sample

From Digi Developer

Jump to: navigation, search

This page contains a sample on how to use the Temperature API on Digi devices.

## From the digihw library, import the temperature handle
from digihw import temperature
## Get a sample reading in Celsius
sample = temperature()
print "Celsius: ", sample
## Convert it to Fahrenheit
f_sample = (9.0/5.0) * sample + 32
print "Fahrenheit: ", f_sample
Personal tools
Wiki Editing