View Single Post
Old 13-05-2009, 12:29 AM   #1
thanhl0nglee
Nhập môn đệ tử
 
Tham gia ngày: Apr 2009
Bài gửi: 4
:
Cách mô phỏng led matrix

Em đang học về led metrix.Muốn thực hành xíu,mà cái mạch nạp JDM nó bị lỗi j j ko biết.Nên phải dùng Proteus để mô phỏng.Mà sao mô phỏng cái chữ A mà ko đc.Hjc hjc
Nhờ các bác chị hộ.Bác nào có tài liệu về mô phỏng Proteus thì cho em với.
Đây là đoạn code em viết
Code:
#include <16F877a.h>
#fuses XT,NOWDT,NOPROTECT,NOLVP
#device 16F877*=16 ADC=8
#use delay(clock=4000000)
#use fast_io(a)
#byte porta=0x05
#use fast_io(b)
#byte portb=0x06
#use fast_io(c)
#byte portc=0x07
#use fast_io(d)
#byte portd=0x08
#use fast_io(e)
#byte porte=0x09
int data[] = {0x00,0xf8,0x24,0x22,0x24,0xf8,0x00,0x00};
int quet[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
int i;
void main(void)
{
   set_tris_b(0x00);
   set_tris_d(0x00);
   while(1)
      {
         for(i=0;i<8;i++)
            {
               portb = data[i];
               portd = quet[i];
               delay_ms(100);
               portb = 0x00;
            }
      }
}
Hình Kèm Theo
File Type: jpg 1.JPG (238.3 KB, 213 lần tải)
thanhl0nglee vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn