That is not it.
The multiplexers are a big switch.
The Common I/O line is connected to one of the I/O lines when the Enable line is active (high or low, need to look it up on the datasheet). The address lines ABCD select which one is connected. The arduino will create those addresses and control the enable line.
The shift register will then store the state of the selected I/O line when its Load line is active. For a '165 type part, that happens when the Load line is low and goes high (pin 1 for 74hc165).
The clock line is driven by the shift-in command to bring the data into the arduino.
So what you doing is this:
enable the multiplexers (can be enabled all the time for this use)
for (address_bit_d = 0 to 1)
for (address_bit_c = 0 to 1)
for (address_bit_b = 0 to 1)
for (address_bit_a = 1 to 1)
// address is now setup, piezo sensor state goes thru the multiplexer to the shift register input
// activate the shift register latch
// shift in the data:
shiftIn(dataPin, clockPin, bitOrder)
so you have 4 loops within loops controlling the address lines, and reading in the data.
Ok, I get the part about the abcd bits, but i still dont understand what those address lines are...
What kind of data do they send to the arduino?
If the piezo sensors are not putting out good digital data, then maybe you will have to read them in analog input pins instead - with 6 4051s, you can use 6 analog inputs.
Or run them thru another analog mux as you noted above.
You said the sensors are on the floor, so I am thinking you will have relatively slowly changing outputs that could look digital.
Well, the piezo sensors are not putting out digital data at all, just an analog signal: voltage
As for the change, that is what we want to measure: the force/speed used to "press" the sensor.
Now, we would like to make some sort of pressure sensitive floor, using Piezo sensors (pressure sensors).
A Piezo sensor does not measure pressure. It turns the differential of the sensor deformation into voltage.
That means as you stand on it you get a signal, as you continue to stand on it the signal goes away and is the same as a sensor not being stood on.
Are you sure this is what you want?
You can get force sensitive resistors.http://www.sparkfun.com/products/9375
but buying 200 will cost some.
You can make your own using conductive foam:-http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html
I think you will have to scale your ambition down, making those 16 took me long enough.
Well, basically what we want is a floor made of buttons, simply said.
But we want to measure the speed/force used to press these buttons, where Piezo elements are supposed to be perfect for. (however, I didnt manage to get it working yet, and i think the problem is my arduino board)
Also, we have a €100,- budget from school to make this project, and we already checked, and those Piezo sensors will fit inside this budget. Note that we only need about 100, not 200. (we changed it a bit)
And yeah, it is ok that the signal dies when you arent standing on the island anymore, and actually, that is exactly what we want
PS: i modified the topic title, it seems more suited like this