Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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
", $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
Comment

PREVIOUS NEXT
Code Example
Shell :: update n98-magerun2 
Shell :: get files traked by git based on size 
Shell :: connect different volumes docker container 
Shell :: pgpassword 
Shell :: bash only start a service if not running 
Shell :: fix ubuntu certificates 
Shell :: commit history 
Shell :: hojarudi 
Shell :: -windows run script on program close 
Shell :: pip install apyori 
Shell :: git ignore more then 10MB 
Shell :: grafana for linux download ubuntu 
Shell :: android emulator for ubuntu 
Shell :: display folder color linux 
Shell :: match first word regex 
Shell :: how to avoid some files changes to not come in git status 
Shell :: how to change elementary os theme 
Shell :: how to find device model of laptop on linux 
Shell :: bash date 
Shell :: skrpt command 
Shell :: installing mysql on aws using putty terminal 
Shell :: powershell show calendar 
Shell :: undo git amend 
Shell :: concat two txt 
Shell :: convert to png images liunx 
Shell :: tar: Cowardly refusing to create an empty archive 
Shell :: shell/bash 
Shell :: wifi drivers realtek 8852 for Ubuntu 
Shell :: symfony skeleton version 
Shell :: delete list of packages linux 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =