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.
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
Color, the sensor evaluates
the color of an object and outputs one of the following values:
0 = No Color
1 = Black
2 = Blue
3 = Green
4 = Yellow
5 = Red
6 = White
7 = Brown
For example, there are EV3-based robots that use
Color mode 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.
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.