Temat: Czytanie z ADS 1015 - NanoPi NEO
System: OpenWrt 19.07.10
Platforma: NanoPi NEO
Dograne moduły:
kmod-hwmon-ads1015
Próbuję czytać wartość napięcia z potencjometru na pokładzie SparkFun Qwiic 12 Bit ADC ADS1015, ale dostaję rozbieżne wartości (widać związek z przekręceniem potencjometru, odczyty wtedy oscylują wokół innej wartości, ale kiedy potencjometr jest nieruszany, wahania są dziwnie duże). Przykład:
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1302
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1371
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1369
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1354
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1322
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1299
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1277
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1266To co robię po kolei:
root@OpenWrt:~# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@OpenWrt:~# echo ads1015 0x48 > /sys/class/i2c-dev/i2c-0/device/new_device
root@OpenWrt:~# ls /sys/class/hwmon/hwmon0/device/
driver in0_input in2_input in4_input in6_input modalias power uevent
hwmon in1_input in3_input in5_input in7_input name subsystem
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1370
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1335
root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/device/in3_input
-1278