kit, connect the light sensor to the EV3 brick in Port 1. On the Block Diagram, place a polymorphic sensor icon, which can be found in the MINDSTORMS I/O menu. The Block Diagram will look like this: This is not the sensor we want, but if you click on Pressed, a menu with different kinds of sensors will appear. Choose Read EV3 Color. A second menu will present itself – choose Detect. Your icon will now look like this:
If you click on the help question mark, click on the sensor icon, and then look at the help window, you will see this: We see the icon outputs numbers. We would like to display the color name detected in the Front Panel window, where we can then record it. A sample Front Panel is shown below: You may want to use a Case Structure to change the output to the Front Panel based on what the sensor detects. You may or may not want to use a While Loop to keep your VI running
You will be provided with a set of sample (artificial) flowers of different colors, against which you should test the color sensor. Because distance from the object affects the color sensor readings, you will need to run tests of the sensor at different distances from the flower target. In this part of the work, you will use a standard Lego spacing as your distance unit. Starting at a distance of approximately 1 Lego units away from the surface, determine the color sensor readings at different distances away. You may simply hold the sensor a known distance from the flower using this Lego as a measuring stick, or you may choose to build a rig to hold the sensor. Data for the different color flowers and distances should be collected and presented in tables in a form similar to that shown below . Get creative and generate your own table format.
- Spring '17
- Color Sensor