Thông báo

Collapse
No announcement yet.

Hiển thị hình Bitmap lên GLCD

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

  • #16
    Anh ơi! Anh có thể cho em hỏi cách tạo hình ảnh đó không anh? Các bước để tạo hình ảnh đó để hiển thị lên GLCD. Mong nhận hồi âm của anh!

    Comment


    • #17
      Hiển thị hình bitmap lên GLCD

      Chào anh MicroDuyPhi !
      Anh có thể cho em biết làm thế nào để tạo được 1 hình bitmap để hiển thị lên GLCD như hình của anh đó. Có phần mềm gì không ạ?



      Nguyên văn bởi MicroDuyphi Xem bài viết
      Đây là một ví dụ minh họa cách đưa ảnh Bitmap lên LCD đồ họa.
      Mạch điện khá đơn giản và dễ lắp ráp, các bạn mới làm với PIC nên bắt tay làm thử vì nó được thiết là dành cho bạn.

      Comment


      • #18
        #include <18f4550-glcd.h>
        #include <hdm64gs12-cv.c>
        #include <graphics.c>

        void welcome()
        {

        int col,row,seg,bit;
        int8 color;

        const byte ht_1[128][8]=
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x02,0x00,0x40,0xf0,0x1f,
        0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x11,
        0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x11,
        0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x11,
        0x00,0x00,0x00,0x00,0x00,0xc4,0xe2,0x0e,
        0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,
        0x00,0x00,0x20,0x00,0x00,0x08,0x00,0x00,
        0x00,0x00,0x10,0x00,0x01,0x20,0xe0,0x0f,
        0x00,0x00,0x10,0x00,0x01,0x00,0x30,0x18,
        0x00,0x00,0x00,0x80,0x00,0x00,0x11,0x10,
        0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x10,
        0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x10,
        0x00,0x00,0x10,0x90,0x88,0x00,0x30,0x18,
        0x00,0x00,0x00,0x21,0x00,0x02,0xe0,0x0f,
        0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
        0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,
        0x00,0x80,0x00,0x00,0x00,0x00,0xf0,0x1f,
        0x00,0x00,0x10,0x40,0x80,0x01,0x70,0x00,
        0x00,0x00,0x10,0x00,0x05,0x00,0xc0,0x01,
        0x00,0x00,0x00,0x44,0x00,0x00,0x00,0x07,
        0x00,0x00,0x08,0x00,0x06,0x20,0x08,0x0e,
        0x00,0x00,0x00,0xe0,0x10,0x01,0xc0,0x01,
        0x00,0x40,0x4a,0x40,0x01,0x00,0x70,0x00,
        0x00,0x40,0x00,0x01,0x06,0x00,0xf0,0x1f,
        0x00,0x40,0x08,0x00,0x2c,0x00,0x04,0x00,
        0x00,0x10,0x80,0x00,0x06,0x00,0x00,0x00,
        0x00,0x10,0x00,0x00,0x00,0x00,0xe0,0x18,
        0x00,0x00,0x04,0xc0,0x08,0x00,0x90,0x11,
        0x00,0x00,0x04,0x42,0x21,0x00,0x10,0x11,
        0x00,0x00,0x00,0x03,0x00,0x02,0x10,0x11,
        0x00,0x00,0x00,0x00,0x08,0x40,0x10,0x13,
        0x00,0x00,0x18,0x00,0x41,0x00,0x31,0x0e,
        0x00,0x00,0x10,0x80,0x10,0x00,0x00,0x00,
        0x00,0x08,0xf4,0x81,0x00,0x01,0x10,0x00,
        0x00,0x00,0x00,0x9f,0x80,0x01,0xf0,0x00,
        0x00,0x10,0x00,0x58,0x10,0x00,0x80,0x07,
        0x00,0x00,0x8a,0x0f,0x40,0x09,0x00,0x1c,
        0x00,0x00,0xf0,0x80,0x00,0x00,0x00,0x1c,
        0x00,0x00,0x70,0x00,0x80,0x00,0x80,0x07,
        0x00,0x00,0x80,0x07,0x00,0x00,0xf0,0x00,
        0x00,0x04,0x01,0x98,0x01,0x00,0x30,0x00,
        0x00,0x04,0x00,0x1f,0x10,0x00,0x00,0x00,
        0x00,0x00,0xf0,0x03,0x00,0x01,0x00,0x00,
        0x00,0x10,0x33,0x80,0x00,0x01,0x00,0x00,
        0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
        0x00,0x00,0xf3,0x1f,0x01,0x00,0x00,0x00,
        0x00,0x00,0x10,0x15,0x12,0x01,0x00,0x00,
        0x00,0x00,0x10,0x11,0x10,0x00,0x00,0x00,
        0x00,0x4c,0x10,0x51,0x00,0x00,0x00,0x00,
        0x00,0x00,0x10,0x11,0x10,0x28,0x00,0x00,
        0x00,0x40,0x10,0x10,0x90,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x40,0xf0,0x1f,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,
        0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x00,
        0x00,0x20,0x04,0x10,0x01,0x00,0x00,0x00,
        0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,
        0x00,0x80,0xc0,0x07,0x20,0x00,0x00,0x00,
        0x00,0x08,0x60,0x0c,0x00,0x10,0x00,0x00,
        0x00,0x00,0x10,0x11,0x02,0x00,0x00,0x00,
        0x00,0x00,0x10,0x18,0x00,0x00,0x00,0x00,
        0x00,0x10,0x10,0x10,0x02,0x00,0x00,0x00,
        0x00,0x00,0x9c,0x10,0x00,0x00,0x00,0x00,
        0x00,0x00,0x20,0x08,0x02,0x04,0x00,0x00,
        0x00,0x10,0x00,0x00,0x40,0x00,0x00,0x00,
        0x00,0x00,0xe0,0x0f,0x00,0x00,0x00,0x00,
        0x00,0x00,0x30,0x18,0x08,0x00,0x00,0x00,
        0x00,0x10,0x30,0x10,0x01,0x00,0x00,0x00,
        0x00,0x04,0x10,0x14,0x00,0x00,0x00,0x00,
        0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,
        0x00,0x00,0x70,0x1c,0x00,0x12,0x00,0x00,
        0x00,0x0a,0xf0,0x8f,0x00,0x02,0x00,0x00,
        0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
        0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,
        0x00,0x00,0xf8,0x1f,0x00,0x00,0x00,0x00,
        0x00,0x01,0x70,0x90,0x00,0x08,0x00,0x00,
        0x00,0x20,0xc8,0x01,0x40,0x00,0x00,0x00,
        0x00,0x02,0x00,0x07,0x00,0x00,0x00,0x00,
        0x00,0x00,0x04,0x0e,0x00,0x08,0x00,0x00,
        0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,
        0x00,0x00,0x70,0x40,0x00,0x00,0x00,0x00,
        0x00,0x00,0xf4,0x1f,0x00,0x00,0x00,0x00,
        0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,
        0x80,0x01,0x20,0x00,0x00,0x00,0x00,0x00,
        0x00,0x27,0xf2,0x1f,0x00,0x04,0x00,0x00,
        0x00,0x00,0x10,0x11,0x00,0x00,0x00,0x00,
        0x00,0x01,0x10,0x11,0x00,0x10,0x00,0x00,
        0x00,0x80,0x11,0x11,0x00,0x00,0x00,0x00,
        0x00,0x00,0x10,0x11,0x80,0x00,0x00,0x00,
        0x00,0x80,0x15,0x10,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x04,0x00,0x40,0x10,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x20,0x18,0x00,0x00,
        0x00,0x00,0x02,0x00,0x00,0x08,0x00,0x00,
        0x00,0x10,0x80,0x00,0x10,0x08,0x00,0x00,
        0x00,0x00,0x01,0x00,0x00,0x05,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
        0x00,0x00,0x00,0x00,0x82,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x00,
        0x00,0x00,0x00,0x00,0x49,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,
        0x00,0x00,0x01,0x10,0x20,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
        0x00,0x00,0x0c,0x00,0x10,0x00,0x00,0x00,
        0x00,0x00,0x30,0x04,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,
        0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
        };

        for(col=0;col<=127;col++)
        {
        for(row=0;row<=7;row++)
        {
        seg=ht_1[col][row];
        for(bit=0;bit<=7;bit++)
        {
        color=bit_test(seg,bit);
        glcd_pixel(col,row*8+bit,color);
        }
        }
        }
        }

        void main()
        {

        glcd_init(on);
        delay_us(100);


        welcome();// hien thi chu " welcom "

        while(true)
        {
        delay_ms(10);
        }

        }

        cách của mình cũng khá đơn giản kết hộp với phần mền tạo bitmap rtb " tìm trên mr.google nhé ".
        Gio tiếp pic18f4550 va glcd.

        Comment

        Về tác giả

        Collapse

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

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

        Collapse

        Đang tải...
        X