Sensor class



The Sensor class defines a simple IR sensor that can be used to both detect relative proximity to objects, and detect relative light levels. Since controllers only need to query the current distance and light value per sensor, the interface to this class is very simple. This class only defines one sensor, so your controller needs to loop through some or all of the Sensor objects in the array reference obtained from the CurrentRobotState class.


Methods

int getDistValue() - returns the current value from distance sensing. This value ranges from 0 - 1023; 1023 being closest proximity.
int getLightValue() - returns the current value from light sensing. This value ranges from 50 - 510; where 500 - 510 corresponds to a complete lack of light.

Back Home