You need to concentrate on getting results for a single sensor.
Debug prints may help.
Then, when that is debugged, it should be relatively easy to expand for all your sensors.
(Your "in1", "in2" etc variables don't need to have global scope, and would probably be better expressed as an array)