Last active
October 24, 2015 11:36
-
-
Save fxadecimal/ca56fc21a672707881bb to your computer and use it in GitHub Desktop.
ds18b20 simple temperature reader
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
| #!/usr/bin/env bash | |
| # Turn on one-wire support for rPi | |
| # https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/ds18b20 | |
| cat /sys/bus/w1/devices/28*/w1_slave |\ | |
| grep t= | awk -F't=' '{print $2}' | \ | |
| python3 -c 'import sys; sys.stdout.write( str( float(sys.stdin.read())/1000 ) )' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment