09-12-2008, 12:32 AM | #1 |
Nhập môn đệ tử
Tham gia ngày: Nov 2008
Bài gửi: 1
: |
các pác cho e hỏi
đây là chứơng trình điều khiển 16 led sáng dồn dùng 2 port b và c nhưng sao nó lại ko chạy mong các pác giúp đỡ,e đưa lên chương trình ccsc và file mô phỏng
#include<16F877A.h> #include<DEF_16F877A.h> #fuses NOWDT,PUT,HS,NOPROTECT,NOLVP #use delay(clock=20000000) #use fast_io(b) #use fast_io(c) int16 sck,slx,bienxoay1,bienluu1,bienxoay2,bienluu2,giat ri1,giatri2; main() { trisb=0; trisc=0; while(true) { sck=16; bienluu1=0; bienluu2=0; portb=0; portc=0; delay_ms(10); while(sck>0) { bienxoay1=1; bienxoay2=1; slx=sck; while(slx>0) { while(slx>8) giatri1=bienluu1|bienxoay1; portb=giatri1; delay_ms(10); bienxoay1=bienxoay1<<1; slx--; } giatri2=bienluu2|bienxoay2; portc=giatri2; delay_ms(10); bienxoay2=bienxoay2<<1; slx--; bienluu1=giatri1; bienluu2=giatri2; sck--; } } } |
Ðiều Chỉnh | |
Xếp Bài | |
|
|