I am developing a device with information output on an LED matrix. The standard typical solution on the MK STM8S105C6T6 + 74HC595.
And so, after running the tests on simple pictures and lines, I ran into a problem, how can I fill these data arrays in the simplest way? After all, each pixel is either 1 or 0, and even in the smallest 8x8 matrix there are as many as 64 pixels.
')
You can, of course, manually, using a notepad to stuff something like this:
But then the array 0 and 1 must be converted to decimal or hexadecimal values ​​corresponding to rows or columns, for example, using an engineering calculator. But it is long and uninteresting. You can write a simple editor in C #, but at work I need to install and configure the environment. But there is Excel at hand! He does an excellent job with such tasks. So let's get started.
To begin with, let's agree that the luminous pixel is “1”, not luminous - “0”. In order for Excel to show us in the “light bulb” table instead of boring numbers, let's use conditional formatting. Let Vs§, which is equal to and greater than 1, be a green circle, and all that is less — not filled with white.
We obtain in the left part of the cells a circle that corresponds to the state of the cell. In the right we see the contents of the cell.
But why do we need to see “0” and “1”? We hide them, for this we need to reduce the width of the cells so that only the “light bulbs” are visible. I got it with the width of the column = "2". Now the fun part. How to turn eight zeros and units in one byte in Excel? To do this, take the school formula for converting a binary number to a decimal.
And finally, we want to get the code of the array to immediately insert into the program and check. To do this, combine the contents of the cells separated by commas using the & &, "&." The result is the formula: