Need help regarding the use of I2C in conjonction with the Joystick Library

Hello there, I’m new to this forum, so please tell me if this post isn’t in the correct section.

I have an Arduino Leonardo and a MCP23017 (which is an I2C I/O expander). It’s for making the gamepad part of a raspberry pi based game console.

I used the Joystick library 2.0 made by Matthew Heironimus to get it working like a standard USB game controller. Everything went well, until i added the part with the mcp23017 communication. The Leonardo still shows up in Device Manager in windows, but nothing is responding. TX led stays OFF.

After narrowing down the code that might got it not working, i then removed the “#include <wire.h>” line and it worked again. I then added only this line of code, and it stopped working again.

Why is that? Is there some kind of incompatibility with the Wire library and the Joystick library 2.0? Or is there another way of getting I2C to work in tandem with this ?

Thanks in advance for any advice

PS: English isn’t my main language, so even if i consider myself pretty good, some errors might be hiding in this message ; if so, firstly please forgive me, and secondly, tell me what’s wrong, it will help me in the future. Thanks!

What is connected to pin 2 and 3 of your Leonardo board ?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.