how to get mcp23017 input in binary shell
# assuming chip is addressed to 0x20
# to setup
sudo i2cset -y 1 0x20 0x00 0x00
# replace 1 with zero on rev1 pi
# iodira is 0x00 and iodirb is 0x01
# setting all pins on gpa to input
# echo as binary address GPIOA is 0x12 and GPIOB is 0x13
echo "ibase=16;obase=2;$(i2cget -y 1 0x20 0x12 b | cut -c3-4)"|bc | BC_LINE_LENGTH=9999 bc | awk '{ printf "%08d\n", $0 }'
# replace 1 with zero on rev1 pi
# Registers are shown on page 16 Table 3-3 of the data sheet https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf
Also in C++:
- how to wget on windows
- unzip ubuntu
- what is regedit in windows
- react slick typescript
- No module named SimpleHTTPServer
- vim plug
- git local branch track remote
- kill all mysql processes
- ubuntu install apache mod_proxy
- gparted ubuntu 20.04
- Lock the screen powershell
- refresh branch list git
- git supprimer branche origin
- linux cut
- comment installer virtualbox sur kali linux
- git ignore whitespace
- changer affichage kali linux
- mysql database drop
- crear rama git checkout
- bash date
- bbedit close without saving
- how to install pip
- ubuntu top bar hide
- shell use command output as string