Knowledge Base

Get Color Name/Reflection Value Block

output-onlinepngtools__231_.png This block works for EV3 and Ruby Robot! output-onlinepngtools__101_.png

The Get Color block allows you to sample the data from the robot's color sensors, which can be configured to point in different directions: straight ahead, facing the sides, or even facing the ground (allowing the robot to identify lines or follow routes drawn on the floor).

The Get Color block supports two different methods of color identification: 
Color Name
Reflection Value

Color Name 

The color sensor can distinguish between several colors, which are either available in a drop-down menu inside a designated data Color block, or can be inserted into the Wait Until block as string values:

mceclip0.png

Note: when using the String data block, the color name must be capitalized. If we use "green", the color sensor would not respond!

mceclip0.png

 

Reflection Value 

When in Reflection Value mode, the color sensor emits a beam of light and measures the intensity of the light reflected back to it in numerical values between 0 (black) and 100 (white) .

This makes the Color Sensor get Reflection Value method ideal for line following using Proportional Control, as it allows for a wide range of values and thus finer control.

mceclip0.png

 

Both Color Name and Reflection Value data is displayed in the HUD:

mceclip2.png

Was this article helpful?
1 out of 1 found this helpful

Comments

Please sign in to leave a comment.