A common question is how to display arrays on the LEGO Mindstorms EV3 brick screen. Displaying values from an array is not different from any other display operation. In this tutorial, we would look at displaying two specific values. The minimum and the maximum for a specific sensor from the Advance Calibration Course Section
- #643
- 04 Oct 2017
- 3:30
- LEGO MINDSTORMS, LEGO MINDSTORMS EV3
- FIRST LEGO League, EV3-G, Sensors, Array, EV3, Display, Light and Color Sensor, FLL, Programming
Displaying array value with a hardcoded index
Three blocks. Access array. Read Operation. Array.
The first block is an array access block. The second is an array operation that read a cell from the array. And the third is a display block.
The same applies also for the Max values.
English
We previously stopped at the program with the calibration and when we start a program it calibrates but it does not display anything on the screen and in this tutorial we would like to display the values from the array to the screen. This here is the program and in this program at the end as we stop we would like to display the minimum and maximum values on the brick screen and for this we'll use the brick screen. And we can display text. Now, the question is: How do we display text on the brick screen from the array? First, I'll take a new variable to read a numeric array and I would like to read from the array the cell with index 2. And this is the minimum value. And I would like to display this value on the screen.
Set the display to wired, we'll clean it and then display the cell with index 2 on the brick screen. Then we want to display the maximum value again read numeric array and an operation for reading from the numeric array and we want to display the value in the cell with index 3. And this is the maximum value for sensor 2. Again a display block like this. Text, wired, without cleaning
so that the values are not one over the other we want to display it on let's say Y=20. And at the end we need a small wait for touching the brick buttons and if we pump the brick button, we'll stop the program. In this way we'll display the minimum and maximum values that the sensor has detected and these are the values that we'll use for our calibration. And in this way you can display values from different arrays. So, the array is MinMax, the operation is read and this is the display block.
Moving with the robot, calibrating and displaying on the brick screen the two values for minimum and maximum for the second sensor - the sensor connected on port 2. So, the minimum is 5 and the maximum is 77. And from here we can use these values to actually detect lines, follow, etc. But first we'll need to also calibrate the other sensors. And we have 3 color sensors. And this is something that we'll do in the next few tutorials.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.

FIRST LEGO League Competition. Constructing and Programming a Robot Base
This course if used by teams, mentors and students to structure the preparation for the Robotics Game of the FIRST LEGO League Robotics Competitions. One thing that is common each year at FLL is that experience matters a lot. Our goal with this course is to quickly bring new teams up to speed with experienced teams and to share some new tricks, patterns, constructions with the more experienced teams.
- 42
- 249:53
- 10
Advanced Light/Color Sensor Calibration
Would you like to resolve all the problems with the light/color sensors that you have? And to make all of them work in a predictable, stable way even when using more than one MINDSTORMS colour sensors.
When using Color sensors it is important to calibrate them depending on the light conditions in your venue. In this way, the calibrated sensor will show values between 0 and 100 independent of the light conditions. But using the default EV3 colour calibration available in the colour sensor block could lead to unpredicted problems that are difficult to track and resolved especially when used with multiple Color sensors. So in this series of tutorial we implement the calibration ourselves discussing the principles of colour sensor calibration.
- 15
- 0
- 4
- 3d_rotation 0