A basic example of controlling an 8 x 8 LED matrix using an Arduino.
Open up Arduino Create and add the following code:
#include <MaxMatrix.h>
int DIN = 7;
int CLK = 6;
int CS = 5;
int maxInUse = 1;
MaxMatrix m(DIN, CS, CLK, maxInUse);
char smile01[] = {8, 8,
B00111100,
B01000010,
B10010101,
B10100001,
B10100001,
B10010101,
B01000010,
B00111100
};
char smile02[] = {8, 8,
B00111100,
B01000010,
B10010101,
B10010001,
B10010001,
B10010101,
B01000010,
B00111100
};
char smile03[] = {8, 8,
B00111100,
B01000010,
B10100101,
B10010001,
B10010001,
B10100101,
B01000010,
B00111100
};
void setup() {
m.init();
m.setIntensity(1);
}
void loop() {
m.writeSprite(0, 0, smile01);
delay( 500 );
m.writeSprite(0, 0, smile02);
delay( 500 );
m.writeSprite(0, 0, smile03);
delay( 500 );
}
You will need to setup the following circuit using your Arduino:
Full tutorial URL:
https://codeadam.ca/learning/arduino-led-matrix.html