A month ago my Raspberry Pi arrived and since then I have been wanting to control external devices with it. Like any other newbie, I was eager to do something with it as soon as possible and spent hours and hours reading and trying out sample codes from experienced Pi users from the internet. After all the countless hours of reading forums and looking at step by step tutorials I am still not confident to directly connect LEDs and buttons to my Pi as I am afraid to fry it up to smokes.
Until I read about the MCP23017 IO Expander from Nathan Chantrell and SKPANG, which from my readings will protect my Pi and give me peace of mind while experimenting with it, so I bought one (Slice of PI/O). Unfortunately, most examples I found are for output only and not so many for input (I guess I just got lazy). With quite a lot of trial and error, I finally figured out how to accept external input using Python with Smbus (i2c). This is the reason why I made this blog, I want to share what I have learned to those like me who has zero knowledge of the Linux operating system, the Python programming language and even in using the i2c to interface the Pi with other devices. I hope this will help minimize the number of hours that will be spent looking for a basic example of programming the GPIO (input and output) of the Raspberry Pi with the MCP23017 IO expander.
I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.