![]() |
|
![]() |
#1 |
Nhập môn đệ tử
Tham gia ngày: Nov 2010
Bài gửi: 5
: |
sao ko ai giup vay???????
|
![]() |
![]() |
![]() |
#2 |
Đệ tử 7 túi
Tham gia ngày: May 2005
Bài gửi: 258
: |
thử như này xem sao:
[code] #include <16F877a.h> #fuses NOWDT,PUT,HS,NOPROTECT #use delay(clock=4000000) #byte portc=0x07 ///khai bao dia chi portb int16 count; int8 a; int j; //Chuong trinh ngat TMR0 #int_timer0 void interrupt_timer0() { set_timer0(0); ++count; if(count==560) { count=0; if(a==1) { for(j=0;j<8;j++) { portc <<=1 // dich trai a 1bit delay_ms((j+1)*50); } } } } //Chuong trinh chinh main() { set_tris_c(0); set_tris_b(0); enable_interrupts(global); enable_interrupts(int_timer0); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_2); set_timer0(0); count=0; a=1; while(true) { portc=a; } }
__________________
viết chương trình cho vdk chạy ổn định là cả một vấn đề. |
![]() |
![]() |