How for this section I bought an IO extender, which with a bit of time, managed to build from the kit provided. The one I went with is called Slice of PI/O which can be found on the CISECO website and bought direct or from eBay. Price was the same and I didn’t have to sign up on eBay since I already have an account.
So once built, I attached it to my PI and booted it up. Right out of the box the PI wont do anything with the IO extender because it has to be told to enable the pins its connected to. For this I followed the instructions at the end of the Slice of PI/O page (Now included below), which lead to the expected result as follows.
Enable i2c by editing the following files
Comment out the line
Add a new line
Installing i2c-tools requires two commands, replace ‘your-userid’ with your login name (the default is pi)
$ sudo apt-get install i2c-tools
$ sudo adduser your-userid i2c
Once everything is installed and rebooted, you should be able to detect the MCP23017 using the following command.
$ i2cdetect -y 0
It should show up on the address you selected.
Right now this means very little to me. All I know is that its working and its address is 0x20. Now how can I use the IO in C# to turn an LED on and off?
I find out later..