Sabtu, 31 Januari 2026

PRAKTIK KARYA INOVASI DAN KEWIRAUSAHAAN 2026

Ketentuan

Satu kelompok terdiri dari maksimal 3 siswa, atau minimal 2 siswa.

 Alat dan bahan

1. Matrix max7219 4 in 1 (1 pcs) contoh

2. Ardunio Nano (1 pcs) contoh

3. Kabel Jumper female to Female (1 pcs) contoh

4. Papan triplek tebal 3 mm luas A4 boleh satu kelas beli urunan satu lembar atau minta ngon sopo asal ojo nyolong ngon pawone wong.

5. Lem super (uhu atau alteco) bisa buat 1 kelas.

TUGAS

- Rangkailah komponen diatas menjadi sebuah papab matrix yang di program menampilkan nama dalam kelompok. Casing terbuat dari papan triplex tersebut di potong menggunakan mesin laser.

Bagian casing terbuat dari 2 bagian yaitu bagian depan-belakang dan bagian samping. Maka siswa perlu melakukan cutting laser 2X

Cara penggunaan Mesin lasernya.

Pemotongan bagian depan



Pemotongan bagian samping



HASIL pemotongan

Hasil potongan triplex

Kemudian susun menjadi jaring jaring balok sebelum dilakukan pengeleman
Penyusunan jaring jaring

Jika sudah yakin maka bisa dilakukan pengeleman bentuk balok
Proses pengeleman bagian depan dan samping

Pasang matrix dan penyangga matrix

Masukkan penyangga matrix berada di tengah- tengah matrix

Untuk contoh list program arduino ide
Menampilkan Nama
Sebagai berikut :
/*  Dot matrix control Scrolling nama

*/


#include <LedControl.h>   //LedControl library: https://www.electronoobs.com/ledcontrol.php


const int numDevices = 4;      // Jumlah Matrix disini pakai 4
const long scrollDelay = 100;   // Atur Kecepatan Geser textnya
unsigned long bufferLong [14] = {0};  
LedControl lc=LedControl(12,11,10,numDevices);//DATA | CLK | CS/LOAD | number of matrices
const unsigned char judul[] PROGMEM ={" OTOTRONIK SMK N 1 SEYEGAN  "};
const unsigned char kelompok[] PROGMEM ={" < < < < < Kelompok XII TO 3 > > > > >"};
const unsigned char nama1[] PROGMEM ={" 1. Kimi Hime "};
const unsigned char nama2[] PROGMEM ={" 2. Young Lek "};
const unsigned char nama3[] PROGMEM ={" 3. Nurhadi-Aldo  "};
void setup()
{
  for (int x=0; x<numDevices; x++)
  {
    lc.shutdown(x,false);       //The MAX72XX is in power-saving mode on startup
    lc.setIntensity(x,1);       // Set the brightness to default value
    lc.clearDisplay(x);         // and clear the display
  }
}
 
void loop(){
    scrollMessage(judul);   //scrollFont();
    scrollMessage(kelompok);
    scrollMessage(nama1);
    scrollMessage(nama2);
    scrollMessage(nama3);
   
}
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
const unsigned char font5x7 [] PROGMEM = {      //Daftar huruf Matrix (Arranged as 7x font data + 1x kerning data)
    B00000000,  //Space (Char 0x20)
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    3,//Kamu dapat merubah Sepasi antar Kata
 
    B01000000,  //!
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B00000000,
    B01000000,
    2,
 
    B10100000,  //"
    B10100000,
    B10100000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    4,
 
    B01010000,  //#
    B01010000,
    B11111000,
    B01010000,
    B11111000,
    B01010000,
    B01010000,
    6,
 
    B00100000,  //$
    B01111000,
    B10100000,
    B01110000,
    B00101000,
    B11110000,
    B00100000,
    6,
 
    B11000000,  //%
    B11001000,
    B00010000,
    B00100000,
    B01000000,
    B10011000,
    B00011000,
    6,
 
    B01100000,  //&
    B10010000,
    B10100000,
    B01000000,
    B10101000,
    B10010000,
    B01101000,
    6,
 
    B11000000,  //'
    B01000000,
    B10000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    3,
 
    B00100000,  //(
    B01000000,
    B10000000,
    B10000000,
    B10000000,
    B01000000,
    B00100000,
    4,
 
    B10000000,  //)
    B01000000,
    B00100000,
    B00100000,
    B00100000,
    B01000000,
    B10000000,
    4,
 
    B00000000,  //*
    B00100000,
    B10101000,
    B01110000,
    B10101000,
    B00100000,
    B00000000,
    6,
 
    B00000000,  //+
    B00100000,
    B00100000,
    B11111000,
    B00100000,
    B00100000,
    B00000000,
    6,
 
    B00000000,  //,
    B00000000,
    B00000000,
    B00000000,
    B11000000,
    B01000000,
    B10000000,
    3,
 
    B00000000,  //-
    B00000000,
    B11111000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,
 
    B00000000,  //.
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B11000000,
    B11000000,
    3,
 
    B00000000,  ///
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    B00000000,
    6,
 
    B01110000,  //0
    B10001000,
    B10011000,
    B10101000,
    B11001000,
    B10001000,
    B01110000,
    6,
 
    B01000000,  //1
    B11000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,
 
    B01110000,  //2
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B11111000,
    6,
 
    B11111000,  //3
    B00010000,
    B00100000,
    B00010000,
    B00001000,
    B10001000,
    B01110000,
    6,
 
    B00010000,  //4
    B00110000,
    B01010000,
    B10010000,
    B11111000,
    B00010000,
    B00010000,
    6,
 
    B11111000,  //5
    B10000000,
    B11110000,
    B00001000,
    B00001000,
    B10001000,
    B01110000,
    6,
 
    B00110000,  //6
    B01000000,
    B10000000,
    B11110000,
    B10001000,
    B10001000,
    B01110000,
    6,
 
    B11111000,  //7
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B00100000,
    B00100000,
    6,
 
    B01110000,  //8
    B10001000,
    B10001000,
    B01110000,
    B10001000,
    B10001000,
    B01110000,
    6,
 
    B01110000,  //9
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B00010000,
    B01100000,
    6,
 
    B00000000,  //:
    B11000000,
    B11000000,
    B00000000,
    B11000000,
    B11000000,
    B00000000,
    3,
 
    B00000000,  //;
    B11000000,
    B11000000,
    B00000000,
    B11000000,
    B01000000,
    B10000000,
    3,
 
    B00010000,  //<
    B00100000,
    B01000000,
    B10000000,
    B01000000,
    B00100000,
    B00010000,
    5,
 
    B00000000,  //=
    B00000000,
    B11111000,
    B00000000,
    B11111000,
    B00000000,
    B00000000,
    6,
 
    B10000000,  //>
    B01000000,
    B00100000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    5,
 
    B01110000,  //?
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B00000000,
    B00100000,
    6,
 
    B01110000,  //@
    B10001000,
    B00001000,
    B01101000,
    B10101000,
    B10101000,
    B01110000,
    6,
 
    B01110000,  //A
    B10001000,
    B10001000,
    B10001000,
    B11111000,
    B10001000,
    B10001000,
    6,
 
    B11110000,  //B
    B10001000,
    B10001000,
    B11110000,
    B10001000,
    B10001000,
    B11110000,
    6,
 
    B01110000,  //C
    B10001000,
    B10000000,
    B10000000,
    B10000000,
    B10001000,
    B01110000,
    6,
 
    B11100000,  //D
    B10010000,
    B10001000,
    B10001000,
    B10001000,
    B10010000,
    B11100000,
    6,
 
    B11111000,  //E
    B10000000,
    B10000000,
    B11110000,
    B10000000,
    B10000000,
    B11111000,
    6,
 
    B11111000,  //F
    B10000000,
    B10000000,
    B11110000,
    B10000000,
    B10000000,
    B10000000,
    6,
 
    B01110000,  //G
    B10001000,
    B10000000,
    B10111000,
    B10001000,
    B10001000,
    B01111000,
    6,
 
    B10001000,  //H
    B10001000,
    B10001000,
    B11111000,
    B10001000,
    B10001000,
    B10001000,
    6,
 
    B11100000,  //I
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,
 
    B00111000,  //J
    B00010000,
    B00010000,
    B00010000,
    B00010000,
    B10010000,
    B01100000,
    6,
 
    B10001000,  //K
    B10010000,
    B10100000,
    B11000000,
    B10100000,
    B10010000,
    B10001000,
    6,
 
    B10000000,  //L
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B11111000,
    6,
 
    B10001000,  //M
    B11011000,
    B10101000,
    B10101000,
    B10001000,
    B10001000,
    B10001000,
    6,
 
    B10001000,  //N
    B10001000,
    B11001000,
    B10101000,
    B10011000,
    B10001000,
    B10001000,
    6,
 
    B01110000,  //O
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,
 
    B11110000,  //P
    B10001000,
    B10001000,
    B11110000,
    B10000000,
    B10000000,
    B10000000,
    6,
 
    B01110000,  //Q
    B10001000,
    B10001000,
    B10001000,
    B10101000,
    B10010000,
    B01101000,
    6,
 
    B11110000,  //R
    B10001000,
    B10001000,
    B11110000,
    B10100000,
    B10010000,
    B10001000,
    6,
 
    B01111000,  //S
    B10000000,
    B10000000,
    B01110000,
    B00001000,
    B00001000,
    B11110000,
    6,
 
    B11111000,  //T
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    6,
 
    B10001000,  //U
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,
 
    B10001000,  //V
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    6,
 
    B10001000,  //W
    B10001000,
    B10001000,
    B10101000,
    B10101000,
    B10101000,
    B01010000,
    6,
 
    B10001000,  //X
    B10001000,
    B01010000,
    B00100000,
    B01010000,
    B10001000,
    B10001000,
    6,
 
    B10001000,  //Y
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    B00100000,
    B00100000,
    6,
 
    B11111000,  //Z
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    B11111000,
    6,
 
    B11100000,  //[
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B11100000,
    4,
 
    B00000000,  //(Backward Slash)
    B10000000,
    B01000000,
    B00100000,
    B00010000,
    B00001000,
    B00000000,
    6,
 
    B11100000,  //]
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B11100000,
    4,
 
    B00100000,  //^
    B01010000,
    B10001000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,
 
    B00000000,  //_
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B11111000,
    6,
 
    B10000000,  //`
    B01000000,
    B00100000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    4,
 
    B00000000,  //a
    B00000000,
    B01110000,
    B00001000,
    B01111000,
    B10001000,
    B01111000,
    6,
 
    B10000000,  //b
    B10000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B11110000,
    6,
 
    B00000000,  //c
    B00000000,
    B01110000,
    B10001000,
    B10000000,
    B10001000,
    B01110000,
    6,
 
    B00001000,  //d
    B00001000,
    B01101000,
    B10011000,
    B10001000,
    B10001000,
    B01111000,
    6,
 
    B00000000,  //e
    B00000000,
    B01110000,
    B10001000,
    B11111000,
    B10000000,
    B01110000,
    6,
 
    B00110000,  //f
    B01001000,
    B01000000,
    B11100000,
    B01000000,
    B01000000,
    B01000000,
    6,
 
    B00000000,  //g
    B01111000,
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B01110000,
    6,
 
    B10000000,  //h
    B10000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B10001000,
    6,
 
    B01000000,  //i
    B00000000,
    B11000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,
 
    B00010000,  //j
    B00000000,
    B00110000,
    B00010000,
    B00010000,
    B10010000,
    B01100000,
    5,
 
    B10000000,  //k
    B10000000,
    B10010000,
    B10100000,
    B11000000,
    B10100000,
    B10010000,
    5,
 
    B11000000,  //l
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,
 
    B00000000,  //m
    B00000000,
    B11010000,
    B10101000,
    B10101000,
    B10001000,
    B10001000,
    6,
 
    B00000000,  //n
    B00000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B10001000,
    6,
 
    B00000000,  //o
    B00000000,
    B01110000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,
 
    B00000000,  //p
    B00000000,
    B11110000,
    B10001000,
    B11110000,
    B10000000,
    B10000000,
    6,
 
    B00000000,  //q
    B00000000,
    B01101000,
    B10011000,
    B01111000,
    B00001000,
    B00001000,
    6,
 
    B00000000,  //r
    B00000000,
    B10110000,
    B11001000,
    B10000000,
    B10000000,
    B10000000,
    6,
 
    B00000000,  //s
    B00000000,
    B01110000,
    B10000000,
    B01110000,
    B00001000,
    B11110000,
    6,
 
    B01000000,  //t
    B01000000,
    B11100000,
    B01000000,
    B01000000,
    B01001000,
    B00110000,
    6,
 
    B00000000,  //u
    B00000000,
    B10001000,
    B10001000,
    B10001000,
    B10011000,
    B01101000,
    6,
 
    B00000000,  //v
    B00000000,
    B10001000,
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    6,
 
    B00000000,  //w
    B00000000,
    B10001000,
    B10101000,
    B10101000,
    B10101000,
    B01010000,
    6,
 
    B00000000,  //x
    B00000000,
    B10001000,
    B01010000,
    B00100000,
    B01010000,
    B10001000,
    6,
 
    B00000000,  //y
    B00000000,
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B01110000,
    6,
 
    B00000000,  //z
    B00000000,
    B11111000,
    B00010000,
    B00100000,
    B01000000,
    B11111000,
    6,
 
    B00100000,  //{
    B01000000,
    B01000000,
    B10000000,
    B01000000,
    B01000000,
    B00100000,
    4,
 
    B10000000,  //|
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    2,
 
    B10000000,  //}
    B01000000,
    B01000000,
    B00100000,
    B01000000,
    B01000000,
    B10000000,
    4,
 
    B00000000,  //~
    B00000000,
    B00000000,
    B01101000,
    B10010000,
    B00000000,
    B00000000,
    6,
 
    B01100000,  // (Char 0x7F)
    B10010000,
    B10010000,
    B01100000,
    B00000000,
    B00000000,
    B00000000,
    5,
   
    B00000000,  // smiley
    B01100000,
    B01100110,
    B00000000,
    B10000001,
    B01100110,
    B00011000,
    5
};
 
void scrollFont() {
    for (int counter=0x20;counter<0x80;counter++){
        loadBufferLong(counter);
        delay(500);
    }
}
 
// Scroll Message
void scrollMessage(const unsigned char * messageString) {
    int counter = 0;
    int myChar=0;
    do {
        // read back a char
        myChar =  pgm_read_byte_near(messageString + counter);
        if (myChar != 0){
            loadBufferLong(myChar);
        }
        counter++;
    }
    while (myChar != 0);
}
// Load character into scroll buffer
void loadBufferLong(int ascii){
    if (ascii >= 0x20 && ascii <=0x7f){
        for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
            unsigned long c = pgm_read_byte_near(font5x7 + ((ascii - 0x20) * 8) + a);     // Index into character table to get row data
            unsigned long x = bufferLong [a*2];     // Load current scroll buffer
            x = x | c;                              // OR the new character onto end of current
            bufferLong [a*2] = x;                   // Store in buffer
        }
        byte count = pgm_read_byte_near(font5x7 +((ascii - 0x20) * 8) + 7);     // Index into character table for kerning data
        for (byte x=0; x<count;x++){
            rotateBufferLong();
            printBufferLong();
            delay(scrollDelay);
        }
    }
}
// Rotate the buffer
void rotateBufferLong(){
    for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
        unsigned long x = bufferLong [a*2];     // Get low buffer entry
        byte b = bitRead(x,31);                 // Copy high order bit that gets lost in rotation
        x = x<<1;                               // Rotate left one bit
        bufferLong [a*2] = x;                   // Store new low buffer
        x = bufferLong [a*2+1];                 // Get high buffer entry
        x = x<<1;                               // Rotate left one bit
        bitWrite(x,0,b);                        // Store saved bit
        bufferLong [a*2+1] = x;                 // Store new high buffer
    }
}  
// Display Buffer on LED matrix
void printBufferLong(){
  for (int a=0;a<7;a++){                    // Loop 7 times for a 5x7 font
    unsigned long x = bufferLong [a*2+1];   // Get high buffer entry
    byte y = x;                             // Mask off first character
    lc.setRow(3,a,y);                       // Send row to relevent MAX7219 chip
    x = bufferLong [a*2];                   // Get low buffer entry
    y = (x>>24);                            // Mask off second character
    lc.setRow(2,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>16);                            // Mask off third character
    lc.setRow(1,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>8);                             // Mask off forth character
    lc.setRow(0,a,y);                       // Send row to relevent MAX7219 chip
  }
}



Hasil Akhir
Manampilkan kelompok dan nama anggotanya








Senin, 26 Januari 2026

Dot Matri Untuk Lampu Belakang Trainer Motor Listrik

Contoh Program

Kabel Biru = Rem

Kabel Kuning = Sein Kanan

Kabel Hijau Sein Kiri


 //  8x8 board besar dengan fungsi tombol pasang di pin 10 dan 11 external pull up ke 5V

// Menampilkan NAMA OTOTRONIK
// Fill in the pins you used on your own setup.

#define ROW_1 8
#define ROW_2 9
#define ROW_3 A1
#define ROW_4 5
#define ROW_5 12
#define ROW_6 A2
#define ROW_7 13
#define ROW_8 A0

#define COL_1 4
#define COL_2 A5
#define COL_3 A4
#define COL_4 7
#define COL_5 A3
#define COL_6 6
#define COL_7 3
#define COL_8 2

const int TombolKiri = 10;
const int TombolKanan = 11;
int Kiri = 1;  // variable for reading the pushbutton status
int Kanan = 1;  // variable for reading the pushbutton status
const byte rows[] = {
    ROW_1, ROW_2, ROW_3, ROW_4, ROW_5, ROW_6, ROW_7, ROW_8
};


// nama siswa Muncul saat kunci kontak ON
byte nama1[] = {0x00,0x00,0x00,0x3c, 0x42,0x42,0x3c,0x00};
byte nama2[] = {0x00,0x00,0x02,0x02,0x7e,0x02,0x02,0x00};
byte nama3[] = {0x00,0x00,0x00,0x3c,0x42,0x42,0x3c,0x00};
byte nama4[] = {0x00, 0x00,0x02,0x02,0x7e,0x02,0x02,0x00};
byte nama5[] = {0x00,0x7e,0x1a,0x2a, 0x4e,0x00,0x00, 0x00};
byte nama6[] = {0x00,0x00,0x00,0x3c,0x42, 0x42,0x3c,0x00};
byte nama7[] = {0x00,0x7e,0x20,0x10, 0x08,0x04,0x7e,0x00};
byte nama8[] = {0x00,0x00,0x00, 0x00,0x7e,0x00,0x00,0x00};
byte nama9[] = {0x00,0x7e,0x08,0x14,0x62,0x00,0x00,0x00};
byte nama10[] = {0x00, 0xFF, 0x38, 0x44, 0x83, 0x00, 0xFF, 0x08};
byte nama11[] = {0xFF, 0x38, 0x44, 0x83, 0x00, 0xFF, 0x08, 0x08};
byte nama12[] = {0x38, 0x44, 0x83, 0x00, 0xFF, 0x08, 0x08, 0xFF};
byte nama13[] = {0x44, 0x83, 0x00, 0xFF, 0x08, 0x08, 0xFF, 0x00};
byte nama14[] = {0x83, 0x00, 0xFF, 0x08, 0x08, 0xFF, 0x00, 0xF9};
byte nama15[] = {0x00, 0xFF, 0x08, 0x08, 0xFF, 0x00, 0xF9, 0x89};
byte nama16[] = {0xFF, 0x08, 0x08, 0xFF, 0x00, 0xF9, 0x89, 0x8F};
byte nama17[] = {0x08, 0x08, 0xFF, 0x00, 0xF9, 0x89, 0x8F, 0x00};
byte nama18[] = {0x08, 0xFF, 0x00, 0xF9, 0x89, 0x8F, 0x00, 0xFF};
byte nama19[] = {0xFF, 0x00, 0xF9, 0x89, 0x8F, 0x00, 0xFF, 0x88};
byte nama20[] = {0x00, 0xF9, 0x89, 0x8F, 0x00, 0xFF, 0x88, 0xFF};
byte nama21[] = {0xF9, 0x89, 0x8F, 0x00, 0xFF, 0x88, 0xFF, 0x00};
byte nama22[] = {0x89, 0x8F, 0x00, 0xFF, 0x88, 0xFF, 0x00, 0xFF};
byte nama23[] = {0x8F, 0x00, 0xFF, 0x88, 0xFF, 0x00, 0xFF, 0x10};
byte nama24[] = {0x00, 0xFF, 0x88, 0xFF, 0x00, 0xFF, 0x10, 0x08};
byte nama25[] = {0xFF, 0x88, 0xFF, 0x00, 0xFF, 0x10, 0x08, 0x04};
byte nama26[] = {0x88, 0xFF, 0x00, 0xFF, 0x10, 0x08, 0x04, 0xFF};
byte nama27[] = {0xFF, 0x00, 0xFF, 0x10, 0x08, 0x04, 0xFF, 0x00};
byte nama28[] = {0x00, 0xFF, 0x10, 0x08, 0x04, 0xFF, 0x00, 0x00};
byte nama29[] = {0xFF, 0x10, 0x08, 0x04, 0xFF, 0x00, 0x00, 0x00};
byte nama30[] = {0x10, 0x08, 0x04, 0xFF, 0x00, 0x00, 0x00, 0x00};
byte nama31[] = {0x08, 0x04, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00};
byte nama32[] = {0x04, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
byte nama33[] = {0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
byte nama34[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

//rem
byte rem1 []={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte rem2 []={0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00};
byte rem3 []={0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00};
byte rem4 []={0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x00};
byte rem5 []={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};

//seinR
byte seinR1 []={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte seinR2 []={0x18, 0x30, 0x60, 0xff, 0xff, 0x60, 0x30, 0x18};
//Sein L
byte seinL1 []={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte seinL2 []={0x18, 0x0c, 0x06, 0xff, 0xff, 0x06, 0x0c, 0x18};

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 <= 9; i++)
        pinMode(i, OUTPUT);
    pinMode(A0, OUTPUT);
    pinMode(A1, OUTPUT);
    pinMode(A2, OUTPUT);
    pinMode(A3, OUTPUT);
    pinMode(A4, OUTPUT);
    pinMode(A5, OUTPUT);
    pinMode(13, OUTPUT);
    pinMode(12, OUTPUT);
    pinMode(TombolKiri, INPUT);
    pinMode(TombolKanan, INPUT);
}

void loop() {
// untuk mendeklarasikan tombol
Kiri = digitalRead(TombolKiri);
Kanan = digitalRead(TombolKanan);

if (Kanan == HIGH && Kiri == LOW) {
  // This could be rewritten to not use a delay, which would make it appear brighter
delay(5);
timeCount += 1;
if(timeCount <  20) {
drawScreen(seinL1);
} else if (timeCount < 40) {
drawScreen(seinL2);
} else {
// back to the start
timeCount = 0;
}}
if (Kanan == LOW && Kiri == HIGH) {
  // This could be rewritten to not use a delay, which would make it appear brighter
delay(5);
timeCount += 1;
if(timeCount <  20) {
drawScreen(seinR1);
} else if (timeCount < 40) {
drawScreen(seinR2);
} else {
// back to the start
timeCount = 0;
}}
if (Kanan == LOW && Kiri == LOW) {
  // This could be rewritten to not use a delay, which would make it appear brighter
delay(5);
timeCount += 2;
if(timeCount <  20) {
drawScreen(rem1);
} else if (timeCount < 40) {
drawScreen(rem2);
} else if (timeCount < 60) {
drawScreen(rem3);
} else if (timeCount < 80) {
drawScreen(rem4);
} else if (timeCount < 100) {
drawScreen(rem5);
}
else {
// back to the start
timeCount = 0;
}}
if (Kanan == HIGH && Kiri == HIGH) {
    delay(5);
timeCount += 1;
if(timeCount <  20) {
drawScreen(nama1);
} else if (timeCount < 40) {
drawScreen(nama2);
} else if (timeCount < 60) {
drawScreen(nama3);
} else if (timeCount < 80) {
drawScreen(nama4);
} else if (timeCount < 100){
drawScreen(nama5);
} else if (timeCount < 120){
drawScreen(nama6);
} else if (timeCount < 140){
drawScreen(nama7);
} else if (timeCount < 160){
drawScreen(nama8);
} else if (timeCount < 180){
drawScreen(nama9);
} else if (timeCount < 200){
drawScreen(nama10);
} else if (timeCount < 220){
drawScreen(nama11);
} else if (timeCount < 240){
drawScreen(nama12);
} else if (timeCount < 260){
drawScreen(nama13);
} else if (timeCount < 280){
drawScreen(nama14);
} else if (timeCount < 300){
drawScreen(nama15);
} else if (timeCount < 320){
drawScreen(nama16);
} else if (timeCount < 340){
drawScreen(nama17);
} else if (timeCount < 360){
drawScreen(nama18);
} else if (timeCount < 380){
drawScreen(nama19);
} else if (timeCount < 400){
drawScreen(nama20);
} else if (timeCount < 420){
drawScreen(nama21);
} else if (timeCount < 440){
drawScreen(nama22);
} else if (timeCount < 460){
drawScreen(nama23);
} else if (timeCount < 480){
drawScreen(nama24);
} else if (timeCount < 500){
drawScreen(nama25);
} else if (timeCount < 520){
drawScreen(nama26);
} else if (timeCount < 540){
drawScreen(nama27);
} else if (timeCount < 560){
drawScreen(nama28);
} else if (timeCount < 580){
drawScreen(nama29);
} else if (timeCount < 600){
drawScreen(nama30);
} else if (timeCount < 620){
drawScreen(nama31);
} else if (timeCount < 640){
drawScreen(nama32);
} else if (timeCount < 660){
drawScreen(nama33);
} else if (timeCount < 680){
drawScreen(nama34);

} else {
// back to the start nama
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.
}