EnxProximitySensor manages functions related to the “Proximity Sensor”. On most devices, the Proximity Sensor is implemented as a boolean-sensor.

  • It returns just two values NEAR or FAR.
  • Thresholding is done on the LUX value i.e. the LUX value of the light Sensor is compared with a threshold.
  • A LUX-value more than the threshold means the Proximity Sensor returns FAR.
  • Anything less than the threshold value, the Sensor returns NEAR

Method: enableProximitySensor ( isEnabled, successCallback, errorCallback )

Parameters: 

  • @param {boolean} isEnabled – Boolean. true to enable and false to disable Proximity Sensor.
  • @param {CallableFunction} successCallback
  • @param {CallableFunction} errorCallback