lansung aja kita bahas
ini skema rangkaian di proteus
nah ini sekarang koding ya di arduino
int nomer=0;
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void SEKEN()
{ digitalWrite(7,HIGH);
delay(1);
digitalWrite(7,LOW);
delay(1);
}
void sexmen()
{ digitalWrite(6,LOW);
delay(0.001);
switch (nomer){
case 0:
digitalWrite(6,HIGH);
delay(1);
digitalWrite(8,HIGH);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,LOW);
SEKEN();
digitalWrite(8,HIGH);//G
SEKEN();
delay(1);
break;
case 1:
digitalWrite(6,HIGH);
delay(1);
digitalWrite(8,HIGH);//G
SEKEN();
digitalWrite(8,HIGH);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,HIGH);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,HIGH);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 2:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,HIGH);//F
SEKEN();
digitalWrite(8,LOW);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,HIGH);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 3:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,HIGH);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 4:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,LOW);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,HIGH);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,HIGH);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 5:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,LOW);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,HIGH);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 6:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,LOW);//F
SEKEN();
digitalWrite(8,LOW);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,HIGH);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 7:
digitalWrite(6,HIGH);
digitalWrite(8,HIGH);//G
SEKEN();
digitalWrite(8,HIGH);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,HIGH);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 8:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,LOW);//F
SEKEN();
digitalWrite(8,LOW);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
case 9:
digitalWrite(6,HIGH);
digitalWrite(8,LOW);//G
SEKEN();
digitalWrite(8,LOW);//F
SEKEN();
digitalWrite(8,HIGH);//E
SEKEN();
digitalWrite(8,LOW);//D
SEKEN();
digitalWrite(8,LOW);//C
SEKEN();
digitalWrite(8,LOW);//B
SEKEN();
digitalWrite(8,LOW);//A
SEKEN();
digitalWrite(8,HIGH);
SEKEN();
delay(1);
break;
}}
void loop()
{
sexmen();
delay(1000);
nomer++;
if(nomer>=10)
{nomer=0;
}
}
udah gituaja jangan bayak bayak wk wk wk
Tidak ada komentar:
Posting Komentar