// Template rangkaian dan code dot matriks
// Untuk 7 segment nya kreasikan sendiri
int katodaLED[]={22,23,24,25,26,27,28,29};
int anodaLED[]={37,36,35,34,33,32,31,30};
int jeda=10;
void setup() {
// put your setup code here, to run once:
for (int nmr=0;nmr<8;nmr++)
{
pinMode(katodaLED[nmr], OUTPUT);
pinMode(anodaLED[nmr], OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
}
void loop() {
for (int i =0; i<30; i++){
// put your main code here, to run repeatedly:
PORTA=B11111110;PORTC=B00000000;delay(jeda);
PORTA=B11111101;PORTC=B01100110;delay(jeda);
PORTA=B11111011;PORTC=B01100110;delay(jeda);
PORTA=B11110111;PORTC=B00000000;delay(jeda);
PORTA=B11101111;PORTC=B00000000;delay(jeda);
PORTA=B11011111;PORTC=B00111100;delay(jeda);
PORTA=B10111111;PORTC=B01000010;delay(jeda);
PORTA=B01111111;PORTC=B10000001;delay(jeda);
}
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
digitalWrite(6, HIGH);
digitalWrite(4, HIGH);
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(6, LOW);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
digitalWrite(6, HIGH);
digitalWrite(4, HIGH);
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(6, LOW);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
delay(1000);
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
delay(1000);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(5, HIGH);
digitalWrite(1, HIGH);
digitalWrite(6, HIGH);
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(5, LOW);
digitalWrite(1, LOW);
digitalWrite(6, LOW);
digitalWrite(2, LOW);
delay(1000);
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
delay(1000);
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(1000);
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(0, LOW);
digitalWrite(1, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(1000);
}