Created code for pi to read data