Skip to content

Instantly share code, notes, and snippets.

@DuqueDeTuring
Created May 27, 2022 11:49
Show Gist options
  • Save DuqueDeTuring/3304e0ce6d78f22fa1e9b8c251944f49 to your computer and use it in GitHub Desktop.
Save DuqueDeTuring/3304e0ce6d78f22fa1e9b8c251944f49 to your computer and use it in GitHub Desktop.
8x8 LED Matrix random pixels
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
void setup() {
Serial.begin(9600);
Serial.println("8x8 LED Matrix random pixels");
randomSeed(analogRead(0));
matrix.begin(0x70);
}
void loop() {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
matrix.drawPixel(i, j, random(0, 2));
}
}
matrix.writeDisplay();
delay(70);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment