Sensor reading inside loop -best way