title: Reading pins from MCP23017 using i2c
body: <p>I am using the MCP23017 with my raspberry pi.. Now I wanted to try and program it.. But I am new at the i2c stuff so was wondering if what I am doing is right or not... I am confused regarding the read/write bit mentioned in the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf" rel="nofollow">datasheet</a></p>
  
  <p>I have connected my A0 pin to Vcc and A1,A2 pins to ground.. So I guess my address would be 0x21.. I have enabled the IOCON.MIRROR bit to '1' so that both INTA/B are set if either port A or port B input changes...
  Now I wanted to clear a interrupt which may occur by reading the INTCAP/Gpio pins .
  So is the following command right to do this -</p>
  
  <pre><code>subprocess.call('i2cget', '-y', '0', '0x21', '0x12')
  </code></pre>
  
  <p>I have a feeling that it is not right...
  Could someone please advice me regarding this..</p>
  
  <p>Thank you in advance,
  Kind Regards,
  Namita.</p>