Follow the DRY principle: Don't Repeat Yourself.
Write code once for one sensor, then instead of copy&paste that code for every further sensor of the same type make your code work with any number of sensors. In a for loop the index variable indicates the currently active sensor number. What else must be known to distinguish multiple sensors?