Class MindsensorsLightSensorArray

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SensorConstants, SensorMode, SensorModes, SampleProvider

    public class MindsensorsLightSensorArray
    extends I2CSensor
    MindSensors Light Senor Array
    This sensor an array of 8 sensors with controlled light source, returning you values of the sensor readings.

    The code for this sensor has not been tested. Please report test results to the leJOS forum.

    Supported modes
    Mode name Description unit(s) Getter
    Red Measures the light value when illuminated with a red light source. N/A, normalized getRedMode()

    Sensor configuration
    The sensor can be calibrated for black and white using the calibrateWhite and calibrateBlack methods.

    The sensor can be put in and out of sleep mode (lights off) using the sleep method and wakeUp methods.

    See Sensor datasheet See Sensor Product page See The leJOS sensor framework See leJOS conventions for SampleProviders

    Author:
    Juan Antonio Brenha Moral, Eric Pascual (EP)
    • Constructor Detail

      • MindsensorsLightSensorArray

        public MindsensorsLightSensorArray​(I2CPort port,
                                           int address)
        Constructor
        Parameters:
        port -
        address - I2C address for the device
      • MindsensorsLightSensorArray

        public MindsensorsLightSensorArray​(I2CPort port)
        Constructor
        Parameters:
        port -
      • MindsensorsLightSensorArray

        public MindsensorsLightSensorArray​(Port port,
                                           int address)
        Constructor
        Parameters:
        port -
        address - I2C address for the device
      • MindsensorsLightSensorArray

        public MindsensorsLightSensorArray​(Port port)
        Constructor
        Parameters:
        port -
    • Method Detail

      • init

        protected void init()
      • sendCommand

        public void sendCommand​(char cmd)
        Send a single byte command represented by a letter
        Parameters:
        cmd - the command to be sent
      • sleep

        public void sleep()
        Sleep the sensor
      • wakeUp

        public void wakeUp()
        Wake up the sensor
      • calibrateWhite

        public void calibrateWhite()
      • calibrateBlack

        public void calibrateBlack()
      • getRedMode

        public SensorMode getRedMode()
        Return a sample provider in that measures the light reflection of a surface illuminated with a red led light. The sensor houses 8 light sensors. Each element in the sample represents one light sensor.