Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5103

Raspberry Pi OS • How to access I2C device from user space

$
0
0
I thought I had this figured out a few months ago but lost the script that was gathering the data and now I can't seem to reproduce this.

I have a Raspberry Pi Zero 2 W. I have a sht45 device connected on the I2C bus. This time I documented my steps at https://www.quietwind.net/wiki/doku.php ... vicedriver. A summary of those steps are below.

1. Enabled I2c using raspi-config
2. After reboot I loaded the sht4x device
```
$ modprobe sht4x
```
3. The sht4x device shows up in the lsmod
```
$ $ lsmod | grep sht4x
sht4x 12288 0
crc8 12288 1 sht4x
```
4, The i2cdetect command can detect it at address 0x44 which is the device's default address
```
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
```

My question is where in /sys can I access the temperature and humidity values that this device provides ?

I have searched and can't seem to find the files to read to get these values.

Thanks
Chris

Statistics: Posted by chriskot870 — Mon Sep 02, 2024 8:57 pm



Viewing all articles
Browse latest Browse all 5103

Trending Articles