-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel_merah.ino
81 lines (64 loc) · 1.91 KB
/
panel_merah.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
#define EN 2
#define SELECT_A 3
#define SELECT_B 4
#define SHIFT_CLK 5
#define STORE_CLK 6
#define DATA 7
#define DELAY_LINE 1
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(EN, OUTPUT);
pinMode(SELECT_A, OUTPUT);
pinMode(SELECT_B, OUTPUT);
pinMode(SHIFT_CLK, OUTPUT);
pinMode(STORE_CLK, OUTPUT);
pinMode(DATA, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int i;
for(i=0;i<128;i++){
digitalWrite(DATA,HIGH) ; // masukkan 1 bit saja
if(i==127-11)
digitalWrite(DATA,LOW) ; // masukkan 1 bit saja
digitalWrite(SHIFT_CLK,LOW) ;
digitalWrite(SHIFT_CLK,HIGH) ;
}
// digitalWrite(EN,LOW) ; // aktifkan outputnya
digitalWrite(SELECT_A,HIGH) ;
digitalWrite(SELECT_B,LOW) ;
digitalWrite(STORE_CLK,LOW) ;
digitalWrite(STORE_CLK,HIGH) ;
// digitalWrite(EN,HIGH) ; // aktifkan outputnya
delay(DELAY_LINE);
for(i=0;i<128;i++){
digitalWrite(DATA,HIGH) ; // masukkan 1 bit saja
if(i==127-63)
digitalWrite(DATA,LOW) ; // masukkan 1 bit saja
digitalWrite(SHIFT_CLK,LOW) ;
digitalWrite(SHIFT_CLK,HIGH) ;
}
// matikan semua
for(i=0;i<128;i++){
digitalWrite(DATA,HIGH) ; // masukkan 1 bit saja
digitalWrite(SHIFT_CLK,LOW) ;
digitalWrite(SHIFT_CLK,HIGH) ;
}
// digitalWrite(EN,LOW) ; // aktifkan outputnya
digitalWrite(SELECT_A,LOW) ;
digitalWrite(SELECT_B,LOW) ;
digitalWrite(STORE_CLK,LOW) ;
digitalWrite(STORE_CLK,HIGH) ;
// digitalWrite(EN,HIGH) ; // aktifkan outputnya
delay(DELAY_LINE);
}