Pages: [1]   Go Down
Author Topic: Arduino Mini 05 I2C  (Read 804 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi there guys. i have just started using the Arduino Mini 05 and am trying to find more information regarding the I2C interface.
From what i saw the Wire.h lib automatically handles the IO. but as far as my testing is going i am not able to get the I2C interface operational.

i am trying to interface to an MCP23016 16bit IIC bus expander.
has anyone managed to get this working and if you don't mind how?

Code:
#include <Wire.h>
const int LED = 13;

void setup() {
  
  pinMode(LED, OUTPUT);
  Wire.begin();
  Wire.beginTransmission(0x40);
  Wire.write(0x06);
  Wire.write(0x00);
  Wire.endTransmission();
  
  
}


void loop() {
    digitalWrite(LED, HIGH);
    delay(1000);
    digitalWrite(LED, LOW);
  
 
  delay(1000);
  
  Wire.beginTransmission(0x40);
  Wire.write(0x00);
  Wire.write(0xFF);
  Wire.endTransmission();
  
}


Moderator edit: [code] [/code] tags added.
« Last Edit: November 07, 2012, 02:55:58 am by Coding Badly » Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
  Wire.beginTransmission(0x40);

The 7-bit address of a standard MCP23016 (all address pins grounded) is 0x20 and not 0x40.
Logged

Pages: [1]   Go Up
Jump to: