go back

Output devices

Riding the wave of last week's assignment, this one doesn't have any kind of connection to my final project either.
I just wanted to work with LED matricies to get a better understanding of how they are programmed and what you can do with them, to gain some knowledge for future projects.
So lets start by talking about the pins on the adafruit 8x8 LED matricies with their HT16K33 backpack boards. They only have GND, VCC, SDA and SCL. That means they talk to the microcontroller over I²C, which means there has to be a way to change the channel they are on, otherwise you couldn't differentiate between them in software. For that the backpack boards have three jumper pads, that can be connected in any order to change the channel of the matrix.
Also I used the same board as last week, since I exposed SDA and SCL in foresight and to save time. I will also try to connect two of the matricies together, so they seem like one 16x8 matrix.

To program them, you need to have the following libraries imported into your project: "Adafruit LED backpack library" and "Adafruit GFX library.
Now we're ready to go, so let's get coding. As always my code is commented, therefore I'm not going to explain everything in detail. But essentially what I'm doing is offsetting the same data on both matricies, to archieve the illusion of one continous matrix.

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

Adafruit_8x8matrix matrix2 = Adafruit_8x8matrix();

void setup() {
  Serial.begin(9600);
  Serial.println("8x8 LED Matrix Test");
  
  matrix.begin(0x71);
  matrix2.begin(0x70);// pass in the address
}

void loop() {
  matrix.setTextSize(1);
  matrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
  matrix.setTextColor(LED_ON);
  matrix.setRotation(3);
  matrix2.setRotation(3);
    matrix2.setTextSize(1);
  matrix2.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
  matrix2.setTextColor(LED_ON);
  for (int8_t x=0; x>=-90; x--) {
    matrix.clear();
    matrix2.clear();
    matrix.setCursor(x,0);
    matrix.print("FabAcademy 2019");
    matrix.writeDisplay();
     
    matrix2.setCursor(x-8,0);
    matrix2.print("FabAcademy 2019");
    matrix2.writeDisplay();
    delay(80);
  }
  
}
              




Group Assignment

Here you can find this week's group assignment.

download the code