Add BMP280/BME280 (tested only on BME); add SHT3x (bug: reads only once)

This commit is contained in:
Edward Emelianov
2025-10-13 00:46:21 +03:00
parent b0097d5ee6
commit 7a37dc0d2f
12 changed files with 568 additions and 26 deletions

View File

@@ -1,16 +1,14 @@
#!/bin/bash
if [[ $# != 1 || $((-(-$1))) != $1 ]]; then
echo "Usage: $0 cnannel" >&2
echo "Usage: $0 cnannel [!0-7 == all off]" >&2
exit 1
fi
if [[ $1 < 0 || $1 > 7 ]]; then
echo "Channel number should be from 0 to 7" >&2
exit 1
fi
CMD="0"
[[ $1 -ge 0 && $1 -le 7 ]] && CMD=$((1 << $1))
echo $((1 << $1))
echo "send $CMD"
i2ctransfer -y 6 w1@0x70 $((1 << $1))
i2cdetect -y -r 6
i2ctransfer -y 6 w1@0x70 $CMD
i2cdetect -y -r 6