Skip to content

Commit

Permalink
make sure raspi-config is there to enable i2c
Browse files Browse the repository at this point in the history
  • Loading branch information
arfrie22 committed Aug 5, 2024
1 parent 3b90546 commit 8f0c187
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
set -e

function enable_i2c {
sudo raspi-config nonint do_i2c 0
sudo dtparam i2c_baudrate=400000
sudo modprobe i2c-dev
if command -v raspi-config &> /dev/null; then
echo "Enabling i2c"
sudo raspi-config nonint do_i2c 0
sudo dtparam i2c_baudrate=400000
sudo modprobe i2c-dev
else
echo "Can not automatically enable i2c you might have to do this manually"
fi
}

DEBUG=""
Expand Down

0 comments on commit 8f0c187

Please sign in to comment.