user4663: I have 16x16 LED matrix and I want to show some custom characters on it. I saw font made with array like this.
const byte zero[16] = { // Create byte array number 0
        B0111110,
        B1111111,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1111111,
        B0111110
    };

But I dont know how to parse it to x, y positions. Can someone help me? Do you know better way to store characters that is easily readable by human? Thanks

user37: To get the value at a particular location, use this code:
boolean val = zero[y] & ((B1 << maxX) >> x);

where y is the y position from 0 to zero.length, maxX is the length of the binary constants minus one (in this case, it would be 6), and x is the x position from 0 to maxX.
For more information, see BitMask.

4663: <p>I have 16x16 LED matrix and I want to show some custom characters on it. I saw font made with array like this.</p>

<pre><code>const byte zero[16] = { // Create byte array number 0
        B0111110,
        B1111111,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1100011,
        B1111111,
        B0111110
    };
</code></pre>

<p>But I dont know how to parse it to x, y positions. Can someone help me? Do you know better way to store characters that is easily readable by human? Thanks</p>
 37: <p>To get the value at a particular location, use this code:</p>

<pre><code>boolean val = zero[y] &amp; ((B1 &lt;&lt; maxX) &gt;&gt; x);
</code></pre>

<p>where <code>y</code> is the y position from 0 to <code>zero.length</code>, <code>maxX</code> is the length of the binary constants minus one (in this case, it would be 6), and <code>x</code> is the x position from 0 to <code>maxX</code>.</p>

<p>For more information, see <a href="http://arduino.cc/en/Tutorial/BitMask" rel="nofollow">BitMask</a>.</p>
