Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
See discussion thread here:
Well it helped me, but not completely. Let me explain what I did.
At the beginning the state of these buttons is unknown, so I read them in my program.
On my Java program, I just made a loop that read the status of these buttons every 2 seconds.
The result is always the same :
But if I leave my program runing and change state of one button (B6 for example) then everything is correct.
So using the information you gave me, I added this to my code before the loop :
I2CBus bus = I2CFactory.getinstance(I2CBus.BUS_1);
Then starting with the same state B6=false and B7=true, now on I have :
1st read (time = 0 second)
So it seems the issue is to read the initial state. Have also seen that ?
I actually did not make the change to the MCP23S17 GPIO provider class yet. The PiFace provider uses a different class impl and thats where I made the change. We should probably look at making the PiFace provider class extend from the MCP23S17 impl to reduce duplication of code. I would need to compare the two implementations to see exactly what are the differences -- I can't recall now why they are two separate ones to begin with :-)