Created
May 27, 2022 11:49
-
-
Save DuqueDeTuring/3304e0ce6d78f22fa1e9b8c251944f49 to your computer and use it in GitHub Desktop.
8x8 LED Matrix random pixels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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