For most sensors and displays someone has already written a library. Install it from the Library Manager, open its examples, and adapt them. Many sensors talk over I2C, which needs only two data wires (SDA and SCL).