I'm finding in practise that this device doesn't seem to play well (so far) with others.
I tested it using the Adafruit mcp 23017 library on a spare Uno, and it worked fine. I can set pins to output mode and light up LEDs consistently.
But when I applied it to my Leo, I got the weirdest results. Hangs in the middle of initialising the 23017 pins, not always at the same exact place in the code. Random pins lighting up, not the ones I thought I was activating. Leo going out to lunch, no longer being seen as connected on its usb port. Having to restart IDE (???) to recover contact with Leo. No Serial monitor capability at all, seem to have lost that entirely. It's as if the board, or the library, or something, is corrupting my Leo's memory...?
I am using Leo native digital ports with LEDs to signal progress through setup() -- blink blue three times to indicate about to init the mcp device, etc. This is the only way I can tell (more or less) what is going on. I can see how far I'm getting and more or less where I hang.
At this point am still scratching my head unable to figure out WTH is going on :-) I thought perhaps I had a bad chip -- so I pulled the IC and replaced it with a brand new spare. This, interestingly, caused my sketch to appear to run correctly just once; after that, the craziness resumed. So perhaps there is something about my setup that is killing 23017 chips? I also thought perhaps the 23017 was pulling too much current and the usb-powered Leo couldn't support it, so I added a sturdy 9v power supply to the mix. That didn't help either.
I have heard this IC described as "troublesome" in the course of googling desperately for a clue. I thought that if it was packaged in a commercial shield it might be "done right" and made easy to use, but now I'm not so sure...
I'm also puzzled by apparent inconsistencies in Adafruit library examples online. Officially they seem to number the GPIO pins from 0-7 (GPIO-A) and 8-15 (GPIO-B), yet I've seen sample code posted online referring to pin numbers higher than 20. Is this just evolution in action?
Anyway, I've been banging my head on this for hours and am about to call it a night and try again tomorrow with a fresh brain, back up a few steps and re-test the unit (both ICs) with the Uno again, etc -- quite time consuming and frustrating. If anyone else has experience of this LinkSprite shield (maybe it's just worthless junk?) or recognises these problems as symptomatic of some elementary error on my part, I'd be very interested to hear from you!