[Tronixstuff] MCP23017 | I2C Port | Help wanted


http://www.youtube.com/watch?feature=player_embedded&v=wiqozeiuev0

hello, i've trying test i2c expander chip (mcp23017) came across http://tronixstuff.wordpress.com/2011/08/26/tutorial-maximising-your-arduinos-io-ports/ tutorial. i've wired expander described in article of 4.7k resistors on ic2 line, i'm using 10k resistors , on i/o pin i'm using 330ohm resistors opposed  560 ohm used in blog post. on result leds, meaning nothing lights up. after reading article on , on found "please note tutorials not compatible arduino ide v1.0. please continue use v22 or v23 until further notice. " tryed use v22 , v23 of ide lead problem in compiler. question can make code compatible v1.0 of ardunio ide?  i doing wrong? i'm trying turn 16 leds on/off in sequence a.k.a knight rider scanner.
here's code:
code: [select]
/*
example 41.1 - microchip mcp23017 arduino
http://tronixstuff.wordpress.com/tutorials > chapter 41
john boxall | cc by-sa-nc
*/

// pins 15~17 gnd, i2c bus address 0x20

#include "wire.h"

void setup()
{
 wire.begin(); // wake i2c bus

 // setup addressing style
 wire.begintransmission(0x20);
 wire.send(0x12);
 wire.send(0x20); // use table 1.4 addressing
 wire.endtransmission();

 // set i/o pins outputs
 wire.begintransmission(0x20);
 wire.send(0x00); // iodira register
 wire.send(0x00); // set of bank outputs
 wire.send(0x00); // set of bank b outputs
 wire.endtransmission();
}

void binarycount()
{
 for (byte a=0; a<256; a++)
 {
   wire.begintransmission(0x20);
   wire.send(0x12); // gpioa
   wire.send(a);    // bank a
   wire.send(a);    // bank b
   wire.endtransmission();
   delay(100);
 }
}

void loop()
{
 binarycount();
 delay(500);
}

any ideas?

read release notes:

http://arduino.cc/en/main/releasenotes

* wire library has been modified use standard read() and
  write() functions instead of send() , receive(). can use
  print() , println() outgoing data.

a little code tweaking needed.


Arduino Forum > Using Arduino > LEDs and Multiplexing > [Tronixstuff] MCP23017 | I2C Port | Help wanted


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial