Detect colors, reflected light, or ambient light
Simulink® Support Package for LEGO® MINDSTORMS® EV3 Hardware
Detect the color of an object, measure reflected light, or measure ambient light.
The block output emits values as uint8.
During simulations without hardware, this block emits zeros. See Block Produces Zeros or Does Nothing in Simulation.
- EV3 brick input port
Identify the EV3 brick input port connected to this sensor. Avoid assigning multiple devices to the same port. The options are
Select the type of measurement to perform,
Reflected light intensity, or
Ambient light intensity.
Color, the sensor evaluates the color of an object and outputs one of the following values:
0= No Color
For example, there are EV3-based robots that use
Colormode solve Rubik’s cube puzzles.
Reflected light intensity, the sensor shines an LED and measures the amount of light reflected by nearby surfaces. The block outputs a normalized value (0-100, dark to light). For example, there are EV3 robots that use this mode to detect and follow a black line around an obstacle course.
Ambient light intensity, the sensor measures the amount of light in its surroundings. The block outputs a normalized value (0-100, dark to light). For example, there are EV3 robots that use this mode to follow a light source.
- Sample time
Specify how often the block reads sensor values.
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.