Đệ tử 2 túi
Tham gia ngày: Nov 2010
Bài gửi: 26
:
|
#include <16F877A.h>
#include <def_16f877a.h>
#fuses NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT
#use delay(clock=12000000)
#USE FAST_IO(A)
#USE FAST_IO(B)
#byte portb=0x05
#byte portb=0x06
unsigned char macot[]={255, 255, 255, 255, 255,
255, 254, 224, 254, 255,
255, 224, 251, 251, 224,
255, 224, 255, 255, 255,
255, 255, 255, 224, 234,
238, 255, 224, 252, 251,
247, 224, 255, 255, 255,
255, 255, 255, 255, 255, };
int8 i,m,k,j;
//**************************chuong trinh chinh**********************************
void main()
{
//ADC_OFF;
set_tris_b(0);
set_tris_a(0);
delay_ms(100);
enable_interrupts(int_timer0);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_2);
enable_interrupts(global);
set_timer0(6);// T_dinhthi = 2*(256 - 6)*1us = 500us
j=0x01;
while(true)
{
//********************************PHUT************** *****************
for(m=0;m<35;m++)
{
for(k=0;k<90;k++)
{
j=0x01;
for(i=0;i<5;i++)
{
portb=macot[i+m];
delay_ms(1);
porta=(j&(0x3f)); //porta=01 0000 0011 1111
j=j<1;
}
porta=0;
}
}
}
}
code của em như thế này mà nó cứ báo là chưa khai bào porta là sao các bác? mong các bác chỉ giúp.
|