Pixel Art

Making Pixel Art is what Matrix likes the most.  Making patterns and displaying them.  In this lesson, you learn how to translate your pattern (make sure to use the PDF template) into a set of pixel to display.

By using an array of bytes, you can simply translate each LED ON to a 1 and each LED OFF to a 0.  Each row is then put into a binary byte in the array.  Make sure your array has 8 rows total, otherwise Matrix will get confused and won't be able to display the entire pattern.  She may simply send you an error or just ignore your command to display the pixels.

Below is the solution to the exercise from page 15.

Here is the code

var five = require('johnny-five');
var board = new five.Board();
  
board.on('ready', function(){
    var heart = [
    "01100110",
    "10011001",
    "10000001",
    "10000001",
    "01000010",
    "00100100",
    "00011000",
    "00000000"
  ];

  matrix = new five.Led.Matrix({
    addresses: [0x70],
    controller: "HT16K33",
    rotation: 1});
  
  matrix.clear();
  matrix.draw(heart);

});