Skip to content

Commit 15ef54a

Browse files
authored
Add files via upload
1 parent c8d8946 commit 15ef54a

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include "LedControl.h"
2+
LedControl lc=LedControl(7,6,5, 1); // urutannya > DIN, CLK, CS, NRDEV
3+
//waktu tunggu yang dideklarasikan di variabel global
4+
unsigned long waktutunggu = 50;
5+
int col;
6+
int row;
7+
int address;
8+
void setup() {
9+
// jumlah perangkat yang telah dirangkai antara arduino dengan dot matrix
10+
int devices=lc.getDeviceCount();
11+
// Inisialisasi semua perangkat (didalam void loop)
12+
for(int address=0;address<devices;address++) {
13+
// IC MAX72XX berada dalam mode sleep saat startup
14+
lc.shutdown(address,false);
15+
// Atur kecerahan ke tingkat menengah.
16+
lc.setIntensity(address,1);
17+
// Kosongkan data di dotmatrix (clear display).
18+
lc.clearDisplay(address);
19+
}
20+
}
21+
void loop() {
22+
// Baca jumlah perangkat
23+
int devices=lc.getDeviceCount();
24+
25+
// perulangan pertama untuk pengisian data 1 persatu - satu
26+
for(row=00;row<8;row++) {
27+
for(col=00;col<8;col++) {
28+
for(address=00;address<devices;address++) {
29+
lc.setLed(address,row,col,true);
30+
delay(waktutunggu);
31+
}
32+
}
33+
}
34+
// perulangan pertama untuk pengosongan data 1 persatu - satu
35+
for(row=00;row<8;row++) {
36+
for(col=00;col<8;col++) {
37+
for(address=0;address<devices;address++) {
38+
lc.setLed(address,row,col,false);
39+
delay(waktutunggu);
40+
}
41+
}
42+
}
43+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include "LedControl.h"
2+
LedControl lc=LedControl(12,11,10,2); // Pins: DIN,CLK,CS, # of Display connected
3+
unsigned long delayTime=200; // Delay between Frames
4+
// Put values in arrays
5+
byte hurufQ[] = {0x00,0x3c,0x42,0x42,0x52,0x4a,0x44,0x3a};
6+
byte hurufB[] = {0x00,0x78,0x44,0x44,0x78,0x44,0x44,0x7c};
7+
byte hurufL[] = {0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x7c};
8+
void setup()
9+
{
10+
lc.shutdown(0,false); // Wake up displays
11+
lc.setIntensity(0,2); // Set intensity levels
12+
lc.clearDisplay(0); // Clear Displays
13+
}
14+
15+
// Take values in Arrays and Display them
16+
void Q()
17+
{
18+
for (int i = 0; i < 8; i++)
19+
{
20+
lc.setRow(0,i,hurufQ[i]);
21+
}
22+
}
23+
void B()
24+
{
25+
for (int i = 0; i < 8; i++)
26+
{
27+
lc.setRow(0,i,hurufB[i]);
28+
}
29+
}
30+
void L()
31+
{
32+
for (int i = 0; i < 8; i++)
33+
{
34+
lc.setRow(0,i,hurufL[i]);
35+
}
36+
}
37+
void loop()
38+
{
39+
// Put #1 frame on both Display
40+
Q();
41+
delay(1000);
42+
//lc.clearDisplay(0);
43+
B();
44+
delay(1000);
45+
L();
46+
delay(1000);
47+
48+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include "LedControl.h"
2+
LedControl lc=LedControl(12,11,10,2); // Pins: DIN,CLK,CS, # of Display connected
3+
unsigned long delayTime=200; // Delay between Frames
4+
// Put values in arrays
5+
byte hurufA[] = {0x3C,0x24,0x24,0x7E,0x62,0x62,0x62,0x00};
6+
byte hurufB[] = {0x7C,0x24,0x24,0x3E,0x32,0x32,0x7E,0x00};
7+
byte hurufC[] =
8+
{
9+
B00111110, // First frame of invader #1
10+
B00100010,
11+
B00100000,
12+
B01100000,
13+
B01100000,
14+
B01100010,
15+
B01111110,
16+
B00000000
17+
};
18+
void setup()
19+
{
20+
lc.shutdown(0,false); // Wake up displays
21+
lc.setIntensity(0,2); // Set intensity levels
22+
lc.clearDisplay(0); // Clear Displays
23+
}
24+
25+
// Take values in Arrays and Display them
26+
void A()
27+
{
28+
for (int i = 0; i < 8; i++)
29+
{
30+
lc.setRow(0,i,hurufA[i]);
31+
}
32+
}
33+
void B()
34+
{
35+
for (int i = 0; i < 8; i++)
36+
{
37+
lc.setRow(0,i,hurufB[i]);
38+
}
39+
}
40+
void C()
41+
{
42+
for (int i = 0; i < 8; i++)
43+
{
44+
lc.setRow(0,i,hurufC[i]);
45+
}
46+
}
47+
void loop()
48+
{
49+
// Put #1 frame on both Display
50+
A();
51+
delay(1000);
52+
//lc.clearDisplay(0);
53+
B();
54+
delay(1000);
55+
C();
56+
delay(1000);
57+
58+
}

0 commit comments

Comments
 (0)