Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Read an I2C Portexpander
printf "76543210 76543210\n"
while :
v=$(i2cget -y 0 $ADDRESS 0x00 w)
echo ${v: -4:4} | xxd -r -p | xxd -b | awk '{split($0,a," "); printf "%s %s\r", a[2], a[3]}'

This comment has been minimized.

Copy link
Owner Author

c7h commented Sep 6, 2018

Reads a 16 bit I2C portexpander like the PCF8575 and displays the result in bit representation.

$ ./ 
76543210 76543210
11111111 10011111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.