Code to work with several peripherals connected to the Raspberry Pi