Thông báo

Collapse
No announcement yet.

Mới làm xong con Led Cube 5x5x5 .Mọi người cùng xem nhé

Collapse
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • #76
    hay lắm, mong bạn phát huy nhiều nữa.
    _--------------------------------------------------

    **** ------------------------------------------***

    Comment


    • #77
      Nguyên văn bởi mrtran0_0 Xem bài viết
      ừ.cái code này anh tự lập trình.nhưng anh lập trình kiểu cơ bản nhất lên code anh viết dài lắm. (vì anh mới học lên mới chỉ biết cách lập trình đơn giản này thôi.hihi
      chém gió thế bạn Code kia 100% code trên machdientu.net mà dám bảo tự mình lập trình hả mới đọc lai từ trang đầu đọc đến câu này thì ko thể nào chấp nhận đc.Mình từng làm nên mình biết.đây là bằng chứng luôn code mình nạp vô dàn led của mình
      V0010 280212 - YouTube
      còn đây là code khác
      12345 - YouTube

      Comment


      • #78
        học hỏi và phát triển thì ko ai nói nhưng đừng lấy của người khác mà bảo là của mình.Cái này gọi là ăn cắp đấy

        Comment


        • #79
          Anh chủ Topic có thể hướng dẫn chi tiết trên Forum được không?

          Comment


          • #80
            anh cho em sơ đồ nguyên lí dạng hình ảnh được không ạ, không cái này máy e ko hỗ trợ..hj

            Comment


            • #81
              quangmanhcube.pdfquangmanhcube.pdf
              1+1=0 nhớ 1

              Comment


              • #82
                chào bạn mình cũng làm xong con cube 5x5x5 nhung nó chỉ chạy dc một làm thì tắt rồi sau đó nó chỉ sáng ở một số cột không biết tại sao bạn biết chỉ bảo hộ mình với không biết là do trở hay sao mình dùng trở 220 ohm và traA1013 và code đây bạn kiểm tra hộ mình nha:
                //trong chuong trinh nay anot la hang con katot la cot hang tu duoi len la 1-5
                #include <REGX52.H>
                #include<stdlib.h>
                unsigned int i,j,k,n;

                sbit d1 = P1^0;
                sbit d2 = P1^1;
                sbit d3 = P1^2;
                sbit d4 = P1^3;
                sbit d5 = P1^4;
                sbit d6 = P1^5;
                sbit d7 = P1^6;
                sbit d8 = P1^7;
                sbit d9 = P3^0;
                sbit d10 = P3^1;
                sbit d11 = P3^2;
                sbit d12 = P3^3;
                sbit d13 = P3^4;
                sbit d14 = P3^5;
                sbit d15 = P3^6;
                sbit d16 = P3^7;
                sbit d17 = P2^0;
                sbit d18 = P2^1;
                sbit d19 = P2^2;

                sbit d20 = P2^3;
                sbit d21 = P2^4;
                sbit d22 = P2^5;
                sbit d23 = P2^6;
                sbit d24 = P2^7;
                sbit led = P0^5;
                sbit d25=P0^5;
                sbit c1 = P0^0;
                sbit c2 = P0^1;
                sbit c3 = P0^2;
                sbit c4 = P0^3;
                sbit c5 = P0^4;
                void delay(unsigned int time)
                {
                while(time--){
                unsigned char j = 125;
                while(j--);
                };}
                // 2chay chu MVK12
                void chuMVK(unsigned char ms, unsigned char n)
                {
                // chu M mat5M
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0xa2;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x64;P1=0xed;P3=0xdf;P2=0xff;led=0; delay(ms);
                P0=0x28;P1=0xcf;P3=0x7f;P2=0xff;led=0; delay(ms);
                P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                }
                //mat4M
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0xa2;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x64;P1=0xf7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                P0=0x28;P1=0xb7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x30;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                }
                //mat3M
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x28;P1=0x7b;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                }
                // mat2M
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0xa2;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0x64;P1=0xfd;P3=0xf7;P2=0xdf;led=1; delay(ms);
                P0=0x28;P1=0xfd;P3=0xfe;P2=0xdb;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                }
                //mat1M
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0xa2;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x64;P1=0xfe;P3=0xfb;P2=0xef;led=1; delay(ms);
                P0=0x28;P1=0xfe;P3=0xfd;P2=0xe7;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                }
                //chay chu v mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                }
                //mat4V
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xbf;P3=0x7f;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                }
                //mat3V
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0x7f;P3=0xff;P2=0xfe;led=1; delay(ms);
                P0=0x64;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x28;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x30;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                }
                //mat2V
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xe7;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfe;P2=0xfd;led=1; delay(ms);
                P0=0x64;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x28;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                }
                // mat1V
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                P0=0x64;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                }
                // chay chu K mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xef;P3=0x7f;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0x3f;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xef;P3=0x7f;P2=0xff;led=1; delay(ms);
                }
                //mat4K
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xf7;P3=0xff;P2=0xfe;led=1; delay(ms);
                P0=0xa2;P1=0xbf;P3=0xff;P2=0xfe;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xdf;P2=0xfe;led=1; delay(ms);
                P0=0x28;P1=0xbf;P3=0xff;P2=0xfe;led=1; delay(ms);
                P0=0x30;P1=0x7f;P3=0xff;P2=0xfe;led=1; delay(ms);
                }
                //mat3K
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfb;P3=0xff;P2=0xfd;led=1; delay(ms);
                P0=0xa2;P1=0x7f;P3=0xff;P2=0xfd;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xef;P2=0xfd;led=1; delay(ms);
                P0=0x28;P1=0x7f;P3=0xff;P2=0xfd;led=1; delay(ms);
                P0=0x30;P1=0xfb;P3=0xff;P2=0xfd;led=1; delay(ms);
                }
                // mat2K
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xff;P2=0xfb;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfe;P2=0xfb;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xf7;P2=0xfb;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xfe;P2=0xfb;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xff;P2=0xfb;led=1; delay(ms);
                }
                // mat1K
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xff;P2=0xf7;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xfb;P2=0xf7;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xff;P2=0xf7;led=1; delay(ms);
                }
                // chay so 12 mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                P0=0xa2;P1=0xff;P3=0xbf;P2=0xff;led=0; delay(ms);
                P0=0x64;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x30;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                }
                //mat4 12
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xdf;P2=0x7f;led=1; delay(ms);
                P0=0x64;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                P0=0x28;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x30;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                }
                //mat3 12
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xef;P2=0xbf;led=1; delay(ms);
                P0=0x64;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x30;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                }
                // mat2 12
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xf7;P2=0xdf;led=1; delay(ms);
                P0=0x64;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                P0=0x28;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                }
                //mat1 12
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfb;P2=0xef;led=1; delay(ms);
                P0=0x64;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                }}
                // 4cac goc cheo nhau sang
                void goccheo(unsigned char ms)
                { P1=P2=P3=0x00;P0=0xff;delay(300);
                P1=P2=P3=0xff;P0=0xff;delay(300);
                {c1=c2=0;c3=c4=c5=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 0;delay(ms);}
                {c4=c5=0;c1=c2=c3=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 1;d11=d12=d13=d18=d19=d20=d21=d22=d23=0;delay(ms); }
                {c1=c2=0;c3=c4=c5=1;d11=d12=d13=d18=d19=d20=d21=d2 2=d23=1;d1=d2=d3=d8=d9=d10=d13=d14=d15=0;delay(ms) ;}
                {c1=c2=c3=1;c4=c5=0;d1=d2=d3=d8=d9=d10=d13=d14=d15 =1;d13=d14=d15=d16=d17=d18=d23=d24=d25=0;delay(ms) ;}
                {c1=c2=0;c3=c4=c5=1;d13=d14=d15=d16=d17=d18=d23=d2 4=d25=1;d3=d4=d5=d6=d7=d8=d13=d14=d15=0;delay(ms); }
                {c4=c5=0;c1=c2=c3=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 1;d13=d14=d15=d16=d17=d18=d23=d24=d25=0;delay(ms); }
                {c1=c2=0;c3=c4=c5=1;d13=d14=d15=d16=d17=d18=d23=d2 4=d25=1;d1=d2=d3=d8=d9=d10=d11=d12=d13=0;delay(ms) ;}
                }
                // chay len xuong theo cot trung tam va mat xung quanh
                void cotmat(unsigned char ms)
                {P1=P2=P3=0xff;led=1;delay(ms);P0=0xff;
                P1=P2=0xff; led=1;P3=0xef; delay(ms);
                c1=1;delay(ms);c1=0;c2=1;delay(ms);c1=c2=0;c3=1;de lay(ms);c1=c2=c3=0;c4=1;delay(ms);c1=c2=c3=c4=0;c5 =1;delay(ms);
                d7=d8=d9=d12=d19=d18=d17=d14=0;delay(ms);d13=1;c5= 0;c4=1;delay(ms);c5=c4=0; c3=1;delay(ms); c5=c4=c3=0;c2=1;delay(ms);
                c5=c4=c3=c2=0;c1=1;delay(ms);d7=d8=d9=d12=d19=d18= d17=d14=1;d1=d2=d3=d4=d5=d6=d15=d16=d25=d24=d23=d2 2=d21=d20=d11=d10=0;delay(ms);
                c1=0;c2=1;delay(ms);c1=c2=0;c3=1;delay(ms);c1=c2=c 3=0;c4=1;delay(ms);c1=c2=c3=c4=0;c5=1;delay(ms);
                P1=P2=P3=0xff;delay(200);
                }
                //quet khung to
                void khungto(unsigned char ms, unsigned char m)
                {
                P0=P1=P2=P3=0xff;delay(100);
                for(i=0;i<=m;i++)
                {
                P0=0x21;P1=0xc0;P3=0x39;P2=0x07;led=0; delay(ms);
                P0=0xa2;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                P0=0x64;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                P0=0x28;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                P0=0x30;P1=0xc0;P3=0x39;P2=0x07;led=0; delay(ms);
                }}
                //quet khung trong long
                void khungnho(unsigned char ms,unsigned char m)
                {
                P0=P1=P2=P3=0xff; delay(200);
                for(i=0;i<=m;i++)
                {
                P0=0x21;P1=P3=P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0x3f;P3=0xd6;P2=0xf8;led=1; delay(ms);
                P0=0x64;P1=0xbf;P3=0xf1;P2=0xfa;led=1; delay(ms);
                P0=0x28;P1=0x3f;P3=0xd6;P2=0xf8;led=1; delay(ms);
                P0=0x30;P1=P3=P2=0xff;led=1; delay(ms);
                }}
                // soc xien quay
                void socxien(unsigned char ms,unsigned char n)
                {
                for(i=0;i<ms;i++)
                {
                //xien cheo1
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xe0;P3=0xff;P2=0xff;led=1; delay(1);
                P0=0xa2;P1=0x1f;P3=0xfc;P2=0xff;led=1; delay(1);
                P0=0x64;P1=0xff;P3=0x83;P2=0xff;led=1; delay(1);
                P0=0x28;P1=0xff;P3=0x7f;P2=0xf0;led=1; delay(1);
                P0=0x30;P1=0xff;P3=0xff;P2=0x0f;led=0; delay(1);
                }
                for(i=0;i<=n;i++)
                {
                c1=c2=c4=c5=0;c3=1;P1=P2=P3=0x00;led=0;delay(1);
                }
                //xien cheo2
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xff;P2=0x0f;led=0; delay(1);
                P0=0xa2;P1=0x7f;P3=0x7f;P2=0xf0;led=1; delay(1);
                P0=0x64;P1=0x7e;P3=0x83;P2=0xff;led=1; delay(1);
                P0=0x28;P1=0x1f;P3=0xfc;P2=0xff;led=1; delay(1);
                P0=0x30;P1=0xe0;P3=0xff;P2=0xff;led=1; delay(1);
                }}}

                //sang theo lop doc
                void theolop2(voi)
                { P0=0xdf;
                P1=P3=0xff;P2=0x0f;led=0;delay(300);
                P1=0xff;P3=0x7f;P2=0x00;led=0;delay(300);
                P1=0xff;P3=0x03;P2=0x00;led=0;delay(300);
                P1=0x1f;P2=P3=0x00;led=0;delay(300);
                P2=P3=0x00;P1=0xe0;led=0;delay(300);
                P2=0x00;led=0;P3=0x7f;P1=0xff;delay(300);
                P2=0xf;P1=P3=0xff;led=0;delay(300);
                P1=P2=P3=0xff;led=1;delay(300);
                for(i=0;i<5;i++)
                {
                d1=d2=d3=d4=d5=d21=d22=d23=d24=d25=0;delay(100);d2 0=d19=d18=d17=d16=d6=d7=d8=d9=d10=0;delay(100);
                d20=d19=d18=d17=d16=d6=d7=d8=d9=d10=1;d11=d12=d13= d14=d15=0;delay(100);
                d11=d12=d13=d14=d15=1;d20=d19=d18=d17=d16=d6=d7=d8 =d9=d10=0;delay(100);
                }}
                //hang internet giunbo
                void giunbo(unsigned char ms,unsigned char n)
                {P0=P1=P2=P3=0xff;
                for(i=0;i<n;i++)
                {
                c5=0;d5=0;delay(ms);d4=0;delay(ms);d3=0;delay(ms); d2=0;delay(ms);d1=0;delay(ms);
                d5=1;delay(ms);d4=1;delay(ms);d3=1;delay(ms);d2=1; delay(ms);d1=1;delay(ms);c5=1;
                c4=0;d3=0;delay(ms);d8=0;delay(ms);d13=0;delay(ms) ;d18=0;delay(ms);d23=0;delay(ms);
                d3=1;delay(ms);d8=1;delay(ms);d13=1;delay(ms);d18= 1;delay(ms);d23=1;delay(ms);c4=1;
                c3=0;d25=0;delay(ms);d17=0;delay(ms);d13=0;delay(m s);d9=0;delay(ms);d1=0;delay(ms);
                d25=1;delay(ms);d17=1;delay(ms);d13=1;delay(ms);d9 =1;delay(ms);d1=1;delay(ms);c3=1;
                c1=0;d21=0;delay(ms);d22=0;delay(ms);d23=0;delay(m s);d24=0;delay(ms);d25=0;delay(ms);
                d21=1;delay(ms);d22=1;delay(ms);d23=1;delay(ms);d2 4=1;delay(ms);d25=1;delay(ms);c1=1;
                c2=0;d5=0;delay(ms);d7=0;delay(ms);d13=0;delay(ms) ;d19=0;delay(ms);d21=0;delay(ms);
                d5=1;delay(ms);d7=1;delay(ms);d13=1;delay(ms);d19= 1;delay(ms);d21=1;delay(ms);c2=1;
                }
                }
                // 3chay chu I lOve you
                void chuiloveu(unsigned char ms, unsigned char n)
                {
                //chu I mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xcf;P3=0x3f;P2=0xfe;led=0; delay(ms);
                P0=0xa2;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xcf;P3=0x3f;P2=0xfe;led=0; delay(ms);
                }
                //mat4 I
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xb7;P3=0xdf;P2=0xbd;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xb7;P3=0xdf;P2=0xff;led=1; delay(ms);
                }
                //mat3 I
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                }
                //mat2 I
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xf7;P2=0xbd;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xf7;P2=0xbd;led=1; delay(ms);
                }
                //mat1 I
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                P0=0x28;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                }
                //chu love mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xdf;P3=0x3f;P2=0xff;led=1; delay(ms);
                P0=0x64;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                P0=0x28;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                P0=0x30;P1=0xcf;P3=0x7f;P2=0xff;led=0; delay(ms);
                }
                //mat4 love
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xbf;P3=0xdf;P2=0xfe;led=1; delay(ms);
                P0=0x64;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                P0=0x28;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                P0=0x30;P1=0xb7;P3=0xff;P2=0x7e;led=1; delay(ms);
                }
                //mat3 love
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0x7f;P3=0xef;P2=0xfd;led=1; delay(ms);
                P0=0x64;P1=0x7e;P3=0xef;P2=0xfd;led=1; delay(ms);
                P0=0x28;P1=0x7e;P3=0xef;P2=0xfd;led=1; delay(ms);
                P0=0x30;P1=0xfb;P3=0xff;P2=0xbd;led=1; delay(ms);
                }
                //mat2 love
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xf6;P2=0xfb;led=1; delay(ms);
                P0=0x64;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                P0=0x28;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xfe;P2=0xdb;led=1; delay(ms);
                }
                //mat1 love
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xfd;P2=0xff;led=1; delay(ms);
                P0=0xa2;P1=0xff;P3=0xf9;P2=0xf7;led=1; delay(ms);
                P0=0x64;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                P0=0x28;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                }
                // chay chu U mat5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                P0=0xa2;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                }
                // mat4 U
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                P0=0xa2;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x64;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x28;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                P0=0x30;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                }
                // mat3 U
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                }
                // mat2 U
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                P0=0xa2;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0x64;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0x28;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                P0=0x30;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                }
                //mat1 U
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                P0=0xa2;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x64;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                }}
                // hai ben duoi nhau
                void duoinhau(unsigned char n)
                {
                //lop1
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                P0=0xa2;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                P0=0x28;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                P0=0x30;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                }
                //lop2
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                P0=0x64;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                P0=0x28;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                P0=0x30;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                }
                //lop3
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                P0=0xa2;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                P0=0x64;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                P0=0x28;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                P0=0x30;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                }
                //lop4
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                P0=0xa2;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                P0=0x64;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                P0=0x28;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                P0=0x30;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                }
                //lop5
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                P0=0xa2;P1=0xff;P3=0x7f;P2=0xff;led=1; delay(1);
                P0=0x64;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                P0=0x28;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                P0=0x30;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                }
                //lop6
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                P0=0xa2;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                P0=0x64;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=1; delay(1);
                P0=0x30;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                }
                //lop7
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                P0=0xa2;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                P0=0x64;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                P0=0x28;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                }
                //lop8
                for(i=0;i<=n;i++)
                {
                P0=0x21;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                P0=0xa2;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                P0=0x64;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                P0=0x30;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                }}
                void main(void)
                {
                while(1)
                {
                chuMVK(1,400);delay(300);
                P0=0xff;P1=P2=P3=0x00;delay(800);
                P0=P1=P2=P3=0xff;delay(300);
                goccheo(150);
                goccheo(100);
                goccheo(50);
                chuiloveu(1,300);delay(200);
                duoinhau(300);
                cotmat(150);
                khungto(200,1);
                khungnho(200,1);
                P0=0x040;P1=P2=0xff;P1=0xef;delay(500);
                khungnho(200,1);
                khungto(200,1);
                socxien(5,500);delay(300);
                theolop1();delay(150);
                theolop2();delay(150);
                giunbo(100,4);
                }}
                cám ơn
                1+1=0 nhớ 1

                Comment


                • #83
                  code này dung thử xem dc không nha:
                  //trong chuong trinh nay anot la hang con katot la cot hang tu duoi len la 1-5
                  #include <REGX52.H>
                  #include<stdlib.h>
                  unsigned int i,j,k,n;

                  sbit d1 = P1^0;
                  sbit d2 = P1^1;
                  sbit d3 = P1^2;
                  sbit d4 = P1^3;
                  sbit d5 = P1^4;
                  sbit d6 = P1^5;
                  sbit d7 = P1^6;
                  sbit d8 = P1^7;
                  sbit d9 = P3^0;
                  sbit d10 = P3^1;
                  sbit d11 = P3^2;
                  sbit d12 = P3^3;
                  sbit d13 = P3^4;
                  sbit d14 = P3^5;
                  sbit d15 = P3^6;
                  sbit d16 = P3^7;
                  sbit d17 = P2^0;
                  sbit d18 = P2^1;
                  sbit d19 = P2^2;

                  sbit d20 = P2^3;
                  sbit d21 = P2^4;
                  sbit d22 = P2^5;
                  sbit d23 = P2^6;
                  sbit d24 = P2^7;
                  sbit led = P0^5;
                  sbit d25=P0^5;
                  sbit c1 = P0^0;
                  sbit c2 = P0^1;
                  sbit c3 = P0^2;
                  sbit c4 = P0^3;
                  sbit c5 = P0^4;
                  void delay(unsigned int time)
                  {
                  while(time--){
                  unsigned char j = 125;
                  while(j--);
                  };}
                  // 2chay chu MVK12
                  void chuMVK(unsigned char ms, unsigned char n)
                  {
                  // chu M mat5M
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0xa2;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x64;P1=0xed;P3=0xdf;P2=0xff;led=0; delay(ms);
                  P0=0x28;P1=0xcf;P3=0x7f;P2=0xff;led=0; delay(ms);
                  P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  }
                  //mat4M
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0xa2;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x64;P1=0xf7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                  P0=0x28;P1=0xb7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x30;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  }
                  //mat3M
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x28;P1=0x7b;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  }
                  // mat2M
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0xa2;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0x64;P1=0xfd;P3=0xf7;P2=0xdf;led=1; delay(ms);
                  P0=0x28;P1=0xfd;P3=0xfe;P2=0xdb;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  }
                  //mat1M
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0xa2;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x64;P1=0xfe;P3=0xfb;P2=0xef;led=1; delay(ms);
                  P0=0x28;P1=0xfe;P3=0xfd;P2=0xe7;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  }
                  //chay chu v mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  }
                  //mat4V
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xbf;P3=0x7f;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=1; delay(ms);
                  }
                  //mat3V
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0x7f;P3=0xff;P2=0xfe;led=1; delay(ms);
                  P0=0x64;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x28;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0x7f;led=1; delay(ms);
                  }
                  //mat2V
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xe7;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfe;P2=0xfd;led=1; delay(ms);
                  P0=0x64;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x28;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xff;P2=0xbf;led=1; delay(ms);
                  }
                  // mat1V
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                  P0=0x64;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  }
                  // chay chu K mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xef;P3=0x7f;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0x3f;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xdf;P3=0x7f;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xef;P3=0x7f;P2=0xff;led=1; delay(ms);
                  }
                  //mat4K
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xf7;P3=0xff;P2=0xfe;led=1; delay(ms);
                  P0=0xa2;P1=0xbf;P3=0xff;P2=0xfe;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xdf;P2=0xfe;led=1; delay(ms);
                  P0=0x28;P1=0xbf;P3=0xff;P2=0xfe;led=1; delay(ms);
                  P0=0x30;P1=0x7f;P3=0xff;P2=0xfe;led=1; delay(ms);
                  }
                  //mat3K
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfb;P3=0xff;P2=0xfd;led=1; delay(ms);
                  P0=0xa2;P1=0x7f;P3=0xff;P2=0xfd;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xef;P2=0xfd;led=1; delay(ms);
                  P0=0x28;P1=0x7f;P3=0xff;P2=0xfd;led=1; delay(ms);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0xfd;led=1; delay(ms);
                  }
                  // mat2K
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xff;P2=0xfb;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfe;P2=0xfb;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xf7;P2=0xfb;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xfe;P2=0xfb;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xff;P2=0xfb;led=1; delay(ms);
                  }
                  // mat1K
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xff;P2=0xf7;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xfb;P2=0xf7;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xfd;P2=0xf7;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xff;P2=0xf7;led=1; delay(ms);
                  }
                  // chay so 12 mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xbf;P2=0xff;led=0; delay(ms);
                  P0=0x64;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                  P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x30;P1=0xcf;P3=0xbf;P2=0xff;led=0; delay(ms);
                  }
                  //mat4 12
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xdf;P2=0x7f;led=1; delay(ms);
                  P0=0x64;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                  P0=0x28;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x30;P1=0xb7;P3=0xdf;P2=0x7f;led=1; delay(ms);
                  }
                  //mat3 12
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xef;P2=0xbf;led=1; delay(ms);
                  P0=0x64;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                  P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x30;P1=0x7b;P3=0xef;P2=0xbf;led=1; delay(ms);
                  }
                  // mat2 12
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xf7;P2=0xdf;led=1; delay(ms);
                  P0=0x64;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                  P0=0x28;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xf6;P2=0xdf;led=1; delay(ms);
                  }
                  //mat1 12
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfb;P2=0xef;led=1; delay(ms);
                  P0=0x64;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                  P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                  }}
                  // 4cac goc cheo nhau sang
                  void goccheo(unsigned char ms)
                  { P1=P2=P3=0x00;P0=0xff;delay(300);
                  P1=P2=P3=0xff;P0=0xff;delay(300);
                  {c1=c2=0;c3=c4=c5=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 0;delay(ms);}
                  {c4=c5=0;c1=c2=c3=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 1;d11=d12=d13=d18=d19=d20=d21=d22=d23=0;delay(ms); }
                  {c1=c2=0;c3=c4=c5=1;d11=d12=d13=d18=d19=d20=d21=d2 2=d23=1;d1=d2=d3=d8=d9=d10=d13=d14=d15=0;delay(ms) ;}
                  {c1=c2=c3=1;c4=c5=0;d1=d2=d3=d8=d9=d10=d13=d14=d15 =1;d13=d14=d15=d16=d17=d18=d23=d24=d25=0;delay(ms) ;}
                  {c1=c2=0;c3=c4=c5=1;d13=d14=d15=d16=d17=d18=d23=d2 4=d25=1;d3=d4=d5=d6=d7=d8=d13=d14=d15=0;delay(ms); }
                  {c4=c5=0;c1=c2=c3=1;d3=d4=d5=d6=d7=d8=d13=d14=d15= 1;d13=d14=d15=d16=d17=d18=d23=d24=d25=0;delay(ms); }
                  {c1=c2=0;c3=c4=c5=1;d13=d14=d15=d16=d17=d18=d23=d2 4=d25=1;d1=d2=d3=d8=d9=d10=d11=d12=d13=0;delay(ms) ;}
                  }
                  // chay len xuong theo cot trung tam va mat xung quanh
                  void cotmat(unsigned char ms)
                  {P1=P2=P3=0xff;led=1;delay(ms);P0=0xff;
                  P1=P2=0xff; led=1;P3=0xef; delay(ms);
                  c1=1;delay(ms);c1=0;c2=1;delay(ms);c1=c2=0;c3=1;de lay(ms);c1=c2=c3=0;c4=1;delay(ms);c1=c2=c3=c4=0;c5 =1;delay(ms);
                  d7=d8=d9=d12=d19=d18=d17=d14=0;delay(ms);d13=1;c5= 0;c4=1;delay(ms);c5=c4=0; c3=1;delay(ms); c5=c4=c3=0;c2=1;delay(ms);
                  c5=c4=c3=c2=0;c1=1;delay(ms);d7=d8=d9=d12=d19=d18= d17=d14=1;d1=d2=d3=d4=d5=d6=d15=d16=d25=d24=d23=d2 2=d21=d20=d11=d10=0;delay(ms);
                  c1=0;c2=1;delay(ms);c1=c2=0;c3=1;delay(ms);c1=c2=c 3=0;c4=1;delay(ms);c1=c2=c3=c4=0;c5=1;delay(ms);
                  P1=P2=P3=0xff;delay(200);
                  }
                  //quet khung to
                  void khungto(unsigned char ms, unsigned char m)
                  {
                  P0=P1=P2=P3=0xff;delay(100);
                  for(i=0;i<=m;i++)
                  {
                  P0=0x21;P1=0xc0;P3=0x39;P2=0x07;led=0; delay(ms);
                  P0=0xa2;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                  P0=0x64;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                  P0=0x28;P1=0xee;P3=0xff;P2=0xef;led=0; delay(ms);
                  P0=0x30;P1=0xc0;P3=0x39;P2=0x07;led=0; delay(ms);
                  }}
                  //quet khung trong long
                  void khungnho(unsigned char ms,unsigned char m)
                  {
                  P0=P1=P2=P3=0xff; delay(200);
                  for(i=0;i<=m;i++)
                  {
                  P0=0x21;P1=P3=P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0x3f;P3=0xd6;P2=0xf8;led=1; delay(ms);
                  P0=0x64;P1=0xbf;P3=0xf1;P2=0xfa;led=1; delay(ms);
                  P0=0x28;P1=0x3f;P3=0xd6;P2=0xf8;led=1; delay(ms);
                  P0=0x30;P1=P3=P2=0xff;led=1; delay(ms);
                  }}
                  // soc xien quay
                  void socxien(unsigned char ms,unsigned char n)
                  {
                  for(i=0;i<ms;i++)
                  {
                  //xien cheo1
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xe0;P3=0xff;P2=0xff;led=1; delay(1);
                  P0=0xa2;P1=0x1f;P3=0xfc;P2=0xff;led=1; delay(1);
                  P0=0x64;P1=0xff;P3=0x83;P2=0xff;led=1; delay(1);
                  P0=0x28;P1=0xff;P3=0x7f;P2=0xf0;led=1; delay(1);
                  P0=0x30;P1=0xff;P3=0xff;P2=0x0f;led=0; delay(1);
                  }
                  for(i=0;i<=n;i++)
                  {
                  c1=c2=c4=c5=0;c3=1;P1=P2=P3=0x00;led=0;delay(1);
                  }
                  //xien cheo2
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xff;P2=0x0f;led=0; delay(1);
                  P0=0xa2;P1=0x7f;P3=0x7f;P2=0xf0;led=1; delay(1);
                  P0=0x64;P1=0x7e;P3=0x83;P2=0xff;led=1; delay(1);
                  P0=0x28;P1=0x1f;P3=0xfc;P2=0xff;led=1; delay(1);
                  P0=0x30;P1=0xe0;P3=0xff;P2=0xff;led=1; delay(1);
                  }}}

                  //sang theo lop doc
                  void theolop2(voi)
                  { P0=0xdf;
                  P1=P3=0xff;P2=0x0f;led=0;delay(300);
                  P1=0xff;P3=0x7f;P2=0x00;led=0;delay(300);
                  P1=0xff;P3=0x03;P2=0x00;led=0;delay(300);
                  P1=0x1f;P2=P3=0x00;led=0;delay(300);
                  P2=P3=0x00;P1=0xe0;led=0;delay(300);
                  P2=0x00;led=0;P3=0x7f;P1=0xff;delay(300);
                  P2=0xf;P1=P3=0xff;led=0;delay(300);
                  P1=P2=P3=0xff;led=1;delay(300);
                  for(i=0;i<5;i++)
                  {
                  d1=d2=d3=d4=d5=d21=d22=d23=d24=d25=0;delay(100);d2 0=d19=d18=d17=d16=d6=d7=d8=d9=d10=0;delay(100);
                  d20=d19=d18=d17=d16=d6=d7=d8=d9=d10=1;d11=d12=d13= d14=d15=0;delay(100);
                  d11=d12=d13=d14=d15=1;d20=d19=d18=d17=d16=d6=d7=d8 =d9=d10=0;delay(100);
                  }}
                  //hang internet giunbo
                  void giunbo(unsigned char ms,unsigned char n)
                  {P0=P1=P2=P3=0xff;
                  for(i=0;i<n;i++)
                  {
                  c5=0;d5=0;delay(ms);d4=0;delay(ms);d3=0;delay(ms); d2=0;delay(ms);d1=0;delay(ms);
                  d5=1;delay(ms);d4=1;delay(ms);d3=1;delay(ms);d2=1; delay(ms);d1=1;delay(ms);c5=1;
                  c4=0;d3=0;delay(ms);d8=0;delay(ms);d13=0;delay(ms) ;d18=0;delay(ms);d23=0;delay(ms);
                  d3=1;delay(ms);d8=1;delay(ms);d13=1;delay(ms);d18= 1;delay(ms);d23=1;delay(ms);c4=1;
                  c3=0;d25=0;delay(ms);d17=0;delay(ms);d13=0;delay(m s);d9=0;delay(ms);d1=0;delay(ms);
                  d25=1;delay(ms);d17=1;delay(ms);d13=1;delay(ms);d9 =1;delay(ms);d1=1;delay(ms);c3=1;
                  c1=0;d21=0;delay(ms);d22=0;delay(ms);d23=0;delay(m s);d24=0;delay(ms);d25=0;delay(ms);
                  d21=1;delay(ms);d22=1;delay(ms);d23=1;delay(ms);d2 4=1;delay(ms);d25=1;delay(ms);c1=1;
                  c2=0;d5=0;delay(ms);d7=0;delay(ms);d13=0;delay(ms) ;d19=0;delay(ms);d21=0;delay(ms);
                  d5=1;delay(ms);d7=1;delay(ms);d13=1;delay(ms);d19= 1;delay(ms);d21=1;delay(ms);c2=1;
                  }
                  }
                  // 3chay chu I lOve you
                  void chuiloveu(unsigned char ms, unsigned char n)
                  {
                  //chu I mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xcf;P3=0x3f;P2=0xfe;led=0; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xcf;P3=0x3f;P2=0xfe;led=0; delay(ms);
                  }
                  //mat4 I
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xb7;P3=0xdf;P2=0xbd;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xb7;P3=0xdf;P2=0xff;led=1; delay(ms);
                  }
                  //mat3 I
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                  }
                  //mat2 I
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xf7;P2=0xbd;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xf7;P2=0xbd;led=1; delay(ms);
                  }
                  //mat1 I
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                  P0=0x28;P1=0xff;P3=0xfb;P2=0xff;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xf9;P2=0xef;led=1; delay(ms);
                  }
                  //chu love mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xbf;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xdf;P3=0x3f;P2=0xff;led=1; delay(ms);
                  P0=0x64;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                  P0=0x28;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                  P0=0x30;P1=0xcf;P3=0x7f;P2=0xff;led=0; delay(ms);
                  }
                  //mat4 love
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xdf;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xbf;P3=0xdf;P2=0xfe;led=1; delay(ms);
                  P0=0x64;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                  P0=0x28;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                  P0=0x30;P1=0xb7;P3=0xff;P2=0x7e;led=1; delay(ms);
                  }
                  //mat3 love
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xef;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0x7f;P3=0xef;P2=0xfd;led=1; delay(ms);
                  P0=0x64;P1=0x7e;P3=0xef;P2=0xfd;led=1; delay(ms);
                  P0=0x28;P1=0x7e;P3=0xef;P2=0xfd;led=1; delay(ms);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0xbd;led=1; delay(ms);
                  }
                  //mat2 love
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xf7;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xf6;P2=0xfb;led=1; delay(ms);
                  P0=0x64;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                  P0=0x28;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xfe;P2=0xdb;led=1; delay(ms);
                  }
                  //mat1 love
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xfd;P2=0xff;led=1; delay(ms);
                  P0=0xa2;P1=0xff;P3=0xf9;P2=0xf7;led=1; delay(ms);
                  P0=0x64;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                  P0=0x28;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                  }
                  // chay chu U mat5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xcf;P3=0x3f;P2=0xff;led=0; delay(ms);
                  P0=0xa2;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x64;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  P0=0x30;P1=0xef;P3=0xff;P2=0xff;led=0; delay(ms);
                  }
                  // mat4 U
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xb7;P3=0xdf;P2=0x7e;led=1; delay(ms);
                  P0=0xa2;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x64;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x28;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  P0=0x30;P1=0xf7;P3=0xff;P2=0x7f;led=1; delay(ms);
                  }
                  // mat3 U
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0x7b;P3=0xef;P2=0xbd;led=1; delay(ms);
                  P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(ms);
                  }
                  // mat2 U
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xf6;P2=0xdb;led=1; delay(ms);
                  P0=0xa2;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0x64;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0x28;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  P0=0x30;P1=0xfd;P3=0xff;P2=0xdf;led=1; delay(ms);
                  }
                  //mat1 U
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xf9;P2=0xe7;led=1; delay(ms);
                  P0=0xa2;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x64;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x28;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  P0=0x30;P1=0xfe;P3=0xff;P2=0xef;led=1; delay(ms);
                  }}
                  // hai ben duoi nhau
                  void duoinhau(unsigned char n)
                  {
                  //lop1
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                  P0=0xa2;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                  P0=0x64;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                  P0=0x28;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                  P0=0x30;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                  }
                  //lop2
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                  P0=0xa2;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                  P0=0x64;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                  P0=0x28;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                  P0=0x30;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                  }
                  //lop3
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                  P0=0xa2;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                  P0=0x64;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                  P0=0x28;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                  P0=0x30;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                  }
                  //lop4
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                  P0=0xa2;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                  P0=0x64;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                  P0=0x28;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                  P0=0x30;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                  }
                  //lop5
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xfe;P3=0xff;P2=0xff;led=0; delay(1);
                  P0=0xa2;P1=0xff;P3=0x7f;P2=0xff;led=1; delay(1);
                  P0=0x64;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                  P0=0x28;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                  P0=0x30;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                  }
                  //lop6
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0x7d;P2=0xff;led=1; delay(1);
                  P0=0xa2;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                  P0=0x64;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                  P0=0x28;P1=0xef;P3=0xff;P2=0xff;led=1; delay(1);
                  P0=0x30;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                  }
                  //lop7
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                  P0=0xa2;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                  P0=0x64;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                  P0=0x28;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                  P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                  }
                  //lop8
                  for(i=0;i<=n;i++)
                  {
                  P0=0x21;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                  P0=0xa2;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                  P0=0x64;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                  P0=0x28;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);
                  P0=0x30;P1=0xfd;P3=0xff;P2=0x7f;led=1; delay(1);
                  }}
                  void main(void)
                  {
                  while(1)
                  {
                  chuMVK(1,400);delay(300);
                  P0=0xff;P1=P2=P3=0x00;delay(800);
                  P0=P1=P2=P3=0xff;delay(300);
                  goccheo(150);
                  goccheo(100);
                  goccheo(50);
                  chuiloveu(1,300);delay(200);
                  duoinhau(300);
                  cotmat(150);
                  khungto(200,1);
                  khungnho(200,1);
                  P0=0x040;P1=P2=0xff;P1=0xef;delay(500);
                  khungnho(200,1);
                  khungto(200,1);
                  socxien(5,500);delay(300);
                  theolop1();delay(150);
                  theolop2();delay(150);
                  giunbo(100,4);
                  }}
                  1+1=0 nhớ 1

                  Comment


                  • #84
                    Nguyên văn bởi khunglongi Xem bài viết
                    ec cho minh hoi dung vdk 89s52 thi bo nho rom chi co 8kb ma code ban 23k thi nap kieu ji day
                    pm cho minh : phamthanh1992@gmail.com
                    có kahr ănng là đc đấy vì trong win bao dung lượng khác so vơi mạch nạp nên phải nạp mới biết dc
                    1+1=0 nhớ 1

                    Comment


                    • #85
                      Nguyên văn bởi mrtran0_0 Xem bài viết




                      Mình làm cái đầu tiên lên hơi xấu. Mình đang làm cái khác chắc chắn sẽ đẹp hơn.Mọi người nếu ai thích cái này thỳ pm YM! Mr.Hoang0_0 nhé. Thanks!!!
                      mình cũng vừa làm xong con led cube 5x5x'5 nhưng không hiểu sao nó chỉ sáng dc một lần sau đó chỉ còn lại máy cột sáng thôi mình dung trở 220 và tran A1013 mong bạn chỉ hộ mình nha "" thank""
                      1+1=0 nhớ 1

                      Comment


                      • #86
                        bac chu top oi cho e hoi chut. o cac cong ra cua ic khong can dien tro ak bac?
                        VD nhu p0 p1 p2 y

                        Comment


                        • #87
                          Các bác cho em hỏi chút về phần lập trình
                          ví dụ có đoạn code như này:
                          P0=0x21;P1=0xff;P3=0xbb;P2=0xff;led=1; delay(1);
                          P0=0xa2;P1=0xdf;P3=0xff;P2=0xf7;led=1; delay(1);
                          P0=0x64;P1=0xef;P3=0xff;P2=0xef;led=1; delay(1);
                          P0=0x28;P1=0xf7;P3=0xff;P2=0xdf;led=1; delay(1);
                          P0=0x30;P1=0xfb;P3=0xff;P2=0xbf;led=1; delay(1);

                          thì 0x28 ; 0xfb; 0xff....là gì vậy? Tại sao khi các động các chân cổng bằng lệnh đó thì lại hoạt động.
                          Thank mọi người nhiều!!

                          Comment


                          • #88
                            cai nay ban dung led j z? hjnh nhu la led siu sang phai ko?

                            Comment


                            • #89
                              chào mọi người mình vừa làm xong con cube 5x5x5 mình dùng con trans a1013 trở loại 470 ohm nhưng không biết sao nó sang yếu quá mong mọi người góp ý chỉ hộ mình là do trans hay là do trở nha??? nếu thay thì nên thay loại nào cho hợp lý?? thanhk !!!!!!!!!!!!! " quangmanhvkhk@gmail.com "
                              1+1=0 nhớ 1

                              Comment


                              • #90
                                LED3CHIEU.com

                                sáng mờ hay sáng yếu do rất nhiều nguyên nhân: do cả phần cứng lẫn phần mềm
                                như mình thi đơn giản như hình thôi:
                                Attached Files

                                Comment

                                Về tác giả

                                Collapse

                                mrtran0_0 Tìm hiểu thêm về mrtran0_0

                                Bài viết mới nhất

                                Collapse

                                Đang tải...
                                X