Display a matrix on the brick screen. Simple and easy. Download and run the program to see how
- 17 Mar 2016
The program from the materials section contains all the needed login to display rows and columns of squares on the LEGO Mindstorms EV3 brick and screen.
You can also modify the size of each of the squares. There is a variable called size that you can change and in this way change the size of the squares.
Tasks involve modifying the program in specific ways to learn how it could be used.
Tasks description, submission and evaluation are available to subscribed users.
Subscribe now to access the full capacity and get feedback.
We would first start with a very simple program to just display a grid, a matrix on the brick screen. 4x4
This here is the program. Just download it and run it. It's located below the video. And when you run it you'll get a new matrix, a new grid that's 4 rows by 4 cells. And you can change this in the program. It's a simple program and it just has a few blocks and in these blocks as in the previous programs you can see you have a rows variable and a columns variable. So, let's modify them to see what happens if I modify this to be 7 and I modify this to be 5 I'll have a matrix that's 7 rows by 5 columns. Download and run. I've downloaded. Run. And you can now see that we have a grid, a matrix that's 5 columns - 1, 2, 3, 4, 5 and it has 1, 2, 3, 4, 5 but it must have 7 rows. And probably you can see it here. That the rows continue but there is not enough space on the brick screen. And we've thought about this and you can modify the size of each of the squares. Return back to the program. What we have in the program is a variable and this variable is called size. And this is actually the size of the side of the square. And it's 25 pixels and we won't get into details about this. Let's first change it to 10. And we'll have the size of the square 10x10 7 rows, 5 columns. Run.
And as you can see now we have our grid, our matrix. It has 7 rows. It has 5 columns. And each cell is 10x10 as a size. What you should do now is check out the tasks for this video. Experiment with them. The magic happens in the program in a block called display and it's DisplayField. So, you can also take a look at that. And we'll now enter into more details about the block and how it works. But whenever you need to display a grid or a matrix on the screen you can use this program and experiment with it and display the grid.
Lessons with this tutorial
This tutorial is used in the following lessons