set the mode of the sensor.