LoginSignup
0
0

More than 5 years have passed since last update.

raspberry pi で、IOエクスパンダ MCP23017 の出力ポートを使う

Last updated at Posted at 2017-05-29
mcp23017_out.sh
#! /bin/bash
#
#   mcp23017_out.sh
#
#                   May/29/2017
#
# ------------------------------------------------------------------
echo "*** start ***"
i2cset -y 1 0x20 0x00 0x00
sleep   1
#
for data in 0x10 0x20 0x40 0x80 0x40 0x20 0x10 0x00
do
    echo $data
    i2cset -y 1 0x20 0x14 $data
    sleepenh 0.5 > /dev/null
done
sleep   1
#
echo "*** end ***"
#
# ------------------------------------------------------------------

時々
Error: Write failed
となるが、その時は、mcp23017 の RESET (18番ピン)を使う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0