Minggu, 11 Januari 2026

Praktikum Dot Matrix 8x8

 Unit Yang Digunakan



Contoh List Program Menampilkan angka Dengan Array


// Menampilkan Nama Siswa : ....
// Matrix 8x8 Kecil.

#define ROW_1 11
#define ROW_2 13
#define ROW_3 A0
#define ROW_4 12
#define ROW_5 3
#define ROW_6 A1
#define ROW_7 2
#define ROW_8 A3

#define COL_1 8
#define COL_2 A5
#define COL_3 A4
#define COL_4 10
#define COL_5 A2
#define COL_6 9
#define COL_7 7
#define COL_8 6

const byte rows[] = {
    ROW_1, ROW_2, ROW_3, ROW_4, ROW_5, ROW_6, ROW_7, ROW_8
};

// The display buffer Row By major
// It shows a walking steps (1 = ON, 0 = OFF)
byte ani1[] = {0x00, 0x1c, 0x22, 0x32, 0x2a, 0x26, 0x22, 0x1c};
byte ani2[] = {0x00, 0x08, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x3e};
byte ani3[] = {0x00, 0x1c, 0x22, 0x10, 0x08, 0x04, 0x02, 0x3e};
byte ani4[] = {0x00, 0x1c, 0x22, 0x20, 0x18, 0x20, 0x22, 0x1c};


float timeCount = 0;

void setup() {
    // Open serial port
    Serial.begin(9600);
    
    // Set all used pins to OUTPUT
    // This is very important! If the pins are set to input
    for (byte i = 2; i <= 13; i++)
        pinMode(i, OUTPUT);
    pinMode(A0, OUTPUT);
    pinMode(A1, OUTPUT);
    pinMode(A2, OUTPUT);
    pinMode(A3, OUTPUT);
    pinMode(A4, OUTPUT);
    pinMode(A5, OUTPUT);
}

void loop() {
  // This could be rewritten to not use a delay, which would make it appear brighter
delay(5);
timeCount += 1;
if(timeCount <  20) {
drawScreen(ani1);
} else if (timeCount <  40) {
drawScreen(ani2);
} else if (timeCount <  60) {
drawScreen(ani3);
} else if (timeCount <  80) {
drawScreen(ani4);
} else if (timeCount <  100) {
drawScreen(ani1);
} else if (timeCount <  120) {
drawScreen(ani2);
} else if (timeCount <  140) {
drawScreen(ani3);
} else if (timeCount <  160) {
drawScreen(ani4);
} else {
// back to the start
timeCount = 0;
}
}
 void  drawScreen(byte buffer2[]){
   // Turn on each row in series
    for (byte i = 0; i < 8; i++) {
        setColumns(buffer2[i]); // Set columns for this specific row
        
        digitalWrite(rows[i], HIGH);
        delay(2); // Set this to 50 or 100 if you want to see the multiplexing effect!
        digitalWrite(rows[i], LOW);
    }
}

void setColumns(byte b) {
    digitalWrite(COL_1, (~b >> 0) & 0x01); // Get the 1st bit: 10000000
    digitalWrite(COL_2, (~b >> 1) & 0x01); // Get the 2nd bit: 01000000
    digitalWrite(COL_3, (~b >> 2) & 0x01); // Get the 3rd bit: 00100000
    digitalWrite(COL_4, (~b >> 3) & 0x01); // Get the 4th bit: 00010000
    digitalWrite(COL_5, (~b >> 4) & 0x01); // Get the 5th bit: 00001000
    digitalWrite(COL_6, (~b >> 5) & 0x01); // Get the 6th bit: 00000100
    digitalWrite(COL_7, (~b >> 6) & 0x01); // Get the 7th bit: 00000010
    digitalWrite(COL_8, (~b >> 7) & 0x01); // Get the 8th bit: 00000001
    
    // If the polarity of your matrix is the opposite of mine
    // remove all the '~' above.
}

Silahkan Tuliskan tiap baris Untuk telaah untuk diubah programnya menampilkan No Absen anda.

42 komentar:

  1. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  2. ikhsan fayakun pitoyo13 Januari 2026 pukul 21.06

    Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  3. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  4. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  5. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh pengarang.

      Hapus
  6. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  7. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  8. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  9. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  10. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  11. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  12. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  13. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  14. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  15. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  16. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  17. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  18. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  19. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  20. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  21. Reivan dwi ramadhani13 Januari 2026 pukul 23.04

    Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  22. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  23. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
    Balasan
    1. Komentar ini telah dihapus oleh administrator blog.

      Hapus
  24. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  25. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  26. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  27. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  28. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  29. Muhammad nur ainul yaqin13 Januari 2026 pukul 23.53

    Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  30. Eva Septiana Putri
    XII TO 1//15

    byte Ani 1 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 00, 0 X 00, 0 X00, 0X 00, 0 X 00 } ;

    byte Ani 2 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 00, 0 X 00, 0 X 00, 0X 00, 0 X 3F } ;

    byte Ani 3 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 00, 0 X 00, 0 X 00, 0X 3F, 0 X 29 } ;

    byte Ani 4 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 00, 0 X 00, 0 X 3F, 0X 29, 0 X 29 } ;

    byte Ani 5 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 00, 0 X 3F, 0 X 29, 0X 29, 0 X 29 } ;

    byte Ani 6 [ ] = { 0 X 00, 0 X 00, 0X 00, 0 X 3F, 0 X 29, 0 X 29, 0X 29, 0 X 00 } ;

    byte Ani 7 [ ] = { 0 X 00, 0 X 00, 0X 3F, 0 X 29, 0 X 29, 0 X 29, 0X 00, 0 X 3C } ;

    byte Ani 8 [ ] = { 0 X 00, 0 X 3F, 0X 29, 0 X 29, 0 X 29, 0 X 00, 0X 3C, 0 X 02 } ;

    byte Ani 9 [ ] = { 0 X 3F, 0 X 29, 0X 29, 0 X 29, 0 X 00, 0 X 3C, 0X 02, 0 X 01 } ;

    byte Ani 10 [ ] = { 0 X 29, 0 X 29, 0X 29, 0 X 00, 0 X 3C, 0 X 02, 0X 01, 0 X 02 } ;

    byte Ani 11 [ ] = { 0 X 29, 0 X 29, 0X 00, 0 X 3C, 0 X 02, 0 X 01, 0X 02, 0 X 00 } ;

    byte Ani 12 [ ] = { 0 X 29, 0 X 00, 0X 3C, 0 X 02, 0 X 01, 0 X 02, 0X 00, 0 X 00 } ;

    byte Ani 13 [ ] = { 0 X 00, 0 X 3C, 0X 02, 0 X 01, 0 X 02, 0 X 00, 0X 00, 0 X 1F } ;

    byte Ani 1 4[ ] = { 0 X 3C, 0 X 02, 0X 01, 0 X 02, 0 X 00, 0 X 00, 0X 1F, 0 X 24 } ;

    byte Ani 15 [ ] = { 0 X 02, 0 X 01, 0X 02, 0 X 00, 0 X 00, 0 X 1F, 0X 24, 0 X 24 } ;

    byte Ani 16 [ ] = { 0 X 01, 0 X 02, 0X 00, 0 X 00, 0 X 1F, 0 X 24, 0X 24, 0 X 1F } ;

    byte Ani 17 [ ] = { 0 X 02, 0 X 00, 0X 00, 0 X 1F, 0 X 24, 0 X 24, 0X 1F, 0 X 00 } ;

    byte Ani 18 [ ] = { 0 X 00, 0 X 00, 0X 1F, 0 X 24, 0 X 24, 0 X 1F, 0 X 00, 0 X 00 } ;

    byte Ani 19 [ ] = { 0 X 00, 0 X 1F, 0X 24, 0 X 24, 0 X 1F, 0 X 00, 0X 00, 0 X 00 } ;

    byte Ani 20 [ ] = { 0 X 1F, 0 X 24, 0 X 24, 0 X 1F, 0 X 00, 0 X 00, 0X 00, 0 X 00 } ;

    byte Ani 21 [ ] = { 0 X 24, 0 X 24, 0X 1F, 0 X 00, 0 X 00, 0 X 00, 0X 00, 0 X 00 } ;

    byte Ani 22 [ ] = { 0 X 24, 0 X 1F, 0X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00 } ;

    byte Ani 23 [ ] = { 0 X 1F, 0 X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00 } ;

    byte Ani 24 [ ] = { 0 X 00, 0 X 00, 0x 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00, 0 X 00 } ;


    void loop() {
    // This could be rewritten to not use a delay, which would make it appear brighter
    delay(5);
    timeCount += 1;
    if(timeCount < 20) {
    drawScreen(ani1);
    } else if (timeCount < 40) {
    drawScreen(ani2);
    } else if (timeCount < 60) {
    drawScreen(ani3);
    } else if (timeCount < 80) {
    drawScreen(ani4);
    } else if (timeCount < 100) {
    drawScreen(ani5);
    } else if (timeCount < 120) {
    drawScreen(ani6);
    } else if (timeCount < 140) {
    drawScreen(ani7);
    } else if (timeCount < 160) {
    drawScreen(ani8);
    } else if (timeCount < 180) {
    drawScreen(ani9);
    } else if (timeCount < 200) {
    drawScreen(ani10);
    } else if (timeCount < 220) {
    drawScreen(ani11);
    } else if (timeCount < 240) {
    drawScreen(ani12);
    } else if (timeCount < 260) {
    drawScreen(ani13);
    } else if (timeCount < 280) {
    drawScreen(ani14);
    } else if (timeCount < 300) {
    drawScreen(ani15);
    } else if (timeCount < 320) {
    drawScreen(ani16);
    } else if (timeCount < 340) {
    drawScreen(ani17);
    } else if (timeCount < 360) {
    drawScreen(ani18);
    } else if (timeCount < 380) {
    drawScreen(ani19);
    } else if (timeCount < 400) {
    drawScreen(ani20);
    } else if (timeCount < 440)
    drawScreen(ani21);
    } else if (timeCount < 460) {
    drawScreen(ani22);
    } else if (timeCount < 480) {
    drawScreen(ani23);
    } else if (timeCount < 500) {
    drawScreen(ani24);

    BalasHapus