Combine 2 programs (Sensor + display on I2C LCD)

Thank you for your fast answer !
How can I "make it a function returning a range" ?