Created
January 28, 2025 16:11
-
-
Save ffalt/5746c8f4ef2e03589ada67f47bbd817d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| search=" 26 " | |
| i=0 | |
| while [ "$i" -le 4 ]; do | |
| # echo "Trying bus $i" | |
| probe=`i2cdetect -y "$i" 2>&1` | |
| if echo "$probe" | grep -q "$search" | |
| then | |
| echo "$i" | |
| exit 0 | |
| fi | |
| i=$(( i + 1 )) | |
| done | |
| echo "Bus not found" | |
| exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment