Hello!
I have just taken on the second half of a project within university where I have rigged up a set of light gates connected to the Arduino to measure times and then do speed, distance, time calculations. I'm using the centipede shield by Macetech to provide me with 4 gates (1 per chip) and each uses all 16 ports as inputs from sensors.
So I have a low on all of the chips at initialisation and when something passes the first array and any 1 of the sensors is triggered an interrupt is sent to the arduino and, as per what should happen with the MCP23017 chips, the address of that pin at the time of interrupt should be saved.
This works for a simple simulation where a pulse is sent to one pin to trigger each gate one after the other. At the end it then displays the pin that was triggered and is correct. This is not the case when all pins are used. The details that are presented from the registers make no real sense. I then tried to find a correlation between cryptic numbers rather crudely and discovered that the output that is provided from this addressing changes with every disconnect and reconnect of the arduino(not just a reset button push).
So, what I'm really asking is,
Does anyone have a clue what might be going on?
It always insists that sensor 1 was triggered and then picks a random number of others to mention as well like this ( only every now and then displaying a full 16 bit line as it should... and did with the simulation):
100000001 array 1
1011110000011111 array 2
10001001010100 array 3
100000010000000