Skip to content

Instantly share code, notes, and snippets.

@pdp7
Last active March 16, 2016 13:24
Show Gist options
  • Save pdp7/45a247b7724087850f97 to your computer and use it in GitHub Desktop.
Save pdp7/45a247b7724087850f97 to your computer and use it in GitHub Desktop.
BeagleBone Green: TH02 sensor
root@beaglebone:~# echo si7005 0x40 > /sys/class/i2c-adapter/i2c-2/new_device 

root@beaglebone:~# dmesg |tail -1
[ 5496.770283] i2c i2c-2: new_device: Instantiated device si7005 at 0x40

root@beaglebone:~# find /sys/ -type f |grep iio |grep -v /power/ | xargs more
::::::::::::::
/sys/bus/iio/drivers_autoprobe
::::::::::::::
1
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/dev
::::::::::::::
243:0
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/name
::::::::::::::
2-0040
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_temp_offset
::::::::::::::
-6400
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_temp_raw
::::::::::::::
9268
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_humidityrelative_offset
::::::::::::::
-6144
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_humidityrelative_scale
::::::::::::::
3.906250
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_humidityrelative_raw
::::::::::::::
14576
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/uevent
::::::::::::::
MAJOR=243
MINOR=0
DEVNAME=iio:device0
DEVTYPE=iio_device
::::::::::::::
/sys/devices/platform/ocp/4819c000.i2c/i2c-2/2-0040/iio:device0/in_temp_scale
::::::::::::::
7.812500

Convert in_temp_raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment