May I suggest you try reading some of these: https://docs.particle.io/guide/getting-started/examples/photon/#read-your-photoresistor-function-and-variable