em co viet 1 code dung dk dong co buoc nhung khi mo phong thi kg chay ,Khong biet sai o dau.Mong Bro giup voi
#include<16f877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use fast_io(A)
#use fast_io(B)
#use fast_io(c)
#use fast_io(D)
#define forward input(pin_B2)
const unsigned char bien[] = {0x0e,0x0d,0x0b,0x07};
//unsigned char M[] = {0x11,0x22,0x44,0x88};
//-------------------------
void dc_thuan(){
int8 i=0,j=0;
while(forward== 1){
delay_us(100);
output_D(bien[i--]);
if(i<0){
i=3;
}
}i++;
}
main(){
dc_thuan();
}
#include<16f877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use fast_io(A)
#use fast_io(B)
#use fast_io(c)
#use fast_io(D)
#define forward input(pin_B2)
const unsigned char bien[] = {0x0e,0x0d,0x0b,0x07};
//unsigned char M[] = {0x11,0x22,0x44,0x88};
//-------------------------
void dc_thuan(){
int8 i=0,j=0;
while(forward== 1){
delay_us(100);
output_D(bien[i--]);
if(i<0){
i=3;
}
}i++;
}
main(){
dc_thuan();
}
Comment