- sudo vi /usr/bin/enable-i2c-pins.sh
#!/bin/bash
config-pin p9.17 i2c
config-pin p9.18 i2c
- sudo chmod 755 /usr/bin/enable-i2c-pins.sh
#!/bin/bash | |
set -eu | |
set -o pipefail | |
say() { | |
echo "$@" | sed \ | |
-e "s/\(\(@\(red\|green\|yellow\|blue\|magenta\|cyan\|white\|reset\|b\|u\)\)\+\)[[]\{2\}\(.*\)[]]\{2\}/\1\4@reset/g" \ | |
-e "s/@red/$(tput setaf 1)/g" \ | |
-e "s/@green/$(tput setaf 2)/g" \ |