0% found this document useful (0 votes)
37 views2 pages

Proyek 8

The provided code is an Arduino sketch that initializes pins 2 to 13 as digital outputs and turns off all connected LEDs. It then enters a loop where it sequentially turns on and off specific combinations of LEDs with delays in between. The pattern involves alternating between 'H' (high) and 'K' (low) states for various pins, creating a sequence of LED activations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Proyek 8

The provided code is an Arduino sketch that initializes pins 2 to 13 as digital outputs and turns off all connected LEDs. It then enters a loop where it sequentially turns on and off specific combinations of LEDs with delays in between. The pattern involves alternating between 'H' (high) and 'K' (low) states for various pins, creating a sequence of LED activations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

void setup() {

//------------------pin 2 s/d pin 13 sebagai dig output


for(char i=2;i<14;i++){
pinMode(i, OUTPUT);
}
//------------------Matikan semua LED
for(char i=2;i<14;i++){
digitalWrite(i, 0);
}
//--------Hidupkan H1 + M2 + M3 + M4
digitalWrite(2,1);
digitalWrite(7,1);
digitalWrite(10,1);
digitalWrite(13,1);
}

void loop() {
//-------------H1 + M2 + M3 + M4 ON
digitalWrite(2,1);
digitalWrite(3,0);
digitalWrite(4,0);
delay(3000);
//-------------K1 + M2 + M3 + M4 ON
digitalWrite(2,0);
digitalWrite(3,1);
digitalWrite(4,0);
delay(1000);

//-------------M1 + H2 + M3 + M4 ON
digitalWrite(5,1);
digitalWrite(6,0);
digitalWrite(7,0);
delay(3000);
//-------------M1 + K2 + M3 + M4 ON
digitalWrite(5,0);
digitalWrite(6,1);
digitalWrite(7,0);
delay(1000);

//-------------M1 + M2 + H3 + M4 ON
digitalWrite(8,1);
digitalWrite(9,0);
digitalWrite(10,0);
delay(3000);
//-------------M1 + M2 + K3 + M4 ON
digitalWrite(8,0);
digitalWrite(9,1);
digitalWrite(10,0);
delay(1000);

//-------------M1 + M2 + M3 + H4 ON
digitalWrite(11,1);
digitalWrite(12,0);
digitalWrite(13,0);
delay(3000);
//-------------M1 + M2 + M3 + K4 ON
digitalWrite(11,0);
digitalWrite(12,1);
digitalWrite(13,0);
delay(1000);
}

You might also like