السلام عليكم
انا من الهواه
ارجومساعده
انا عاوز مساعده فى اعدادات mikroC PRO for PIC
pic16f628a
تشغيل مذبذب عن طريق مكثف ومقاومه مشعارف ارجو يكون يالصوره
عاوز اعرف ايه الغير صحيح فى الكود
وكيف اختصار الكود
كود:
char x0=1;
char x1=1;
char x2=1;
char x3=1;
char x4=1;
char x5=1;
char x6=1;
char x7=1;
char x8=1;
char x9=1;
char x10=1;
char x11=1;
char x12=1;
char x13=1;
char x14=1;
char x15=1;
void main() {
cmcon = 7;
trisb=0;
trisb.f7 = 1;
portb.f7 = 0;
if(portb.f7 == 1) goto aa;
if(portb.f7 == 0) goto aa1;
aa:
portb=0b00000001;delay_ms(300);
portb=0b00000010;delay_ms(300);
portb=0b00000100;delay_ms(300);
portb=0b00001000;delay_ms(300);
portb=0b00000000;delay_ms(300);
portb=0b00001000;delay_ms(300);
portb=0b00000100;delay_ms(300);
portb=0b00000010;delay_ms(300);
portb=0b00000001;delay_ms(300);
while(1){
aa1:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x0=x0++;
if(x0==8)goto aa2;}
aa2:
while(1){
portb=0b00000110;delay_ms(300);
portb=0b00001001;delay_ms(300);
if(portb.f7 == 1) goto aa;
x1=x1++;
if(x1==8)goto aa3;}
aa3:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x2=x2++;
if(x2==8)goto aa4;}
aa4:
while(1){
portb=0b00001100;delay_ms(300);
portb=0b00000011; delay_ms(300);
if(portb.f7 == 1) goto aa;
x3=x3++;
if(x3==8)goto aa5;}
aa5:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x4=x4++;
if(x4==8)goto aa6;}
aa6:
while(1){
portb=0b00000101;delay_ms(300);
portb=0b00001010;delay_ms(300);
if(portb.f7 == 1) goto aa;
x5=x5++;
if(x5==8)goto aa7;}
aa7:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x6=x6++;
if(x6==8)goto aa8;}
aa8:
while(1){
portb=0b00000101;delay_ms(300);
portb=0b00001010;delay_ms(300);
if(portb.f7 == 1) goto aa;
x7=x7++;
if(x7==8)goto aa9;}
aa9:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x8=x8++;
if(x8==8)goto aa10;}
aa10:
while(1){
portb=0b00001101;delay_ms(300);
portb=0b00001011;delay_ms(300);
if(portb.f7 == 1) goto aa;
x9=x9++;
if(x9==8)goto aa11;}
aa11:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x10=x10++;
if(x10==8)goto aa;
}
aa12:
while(1){
portb=0b00000000;delay_ms(300);
portb=0b00000001;delay_ms(300);
portb=0b00000010;delay_ms(300);
portb=0b00000100;delay_ms(300);
portb=0b00001000;delay_ms(300);
portb=0b00000100;delay_ms(300);
portb=0b00000010;delay_ms(300);
portb=0b00000001;delay_ms(300);
if(portb.f7 == 1) goto aa;
x10=x10++;
if(x10==8)goto aa13;
}
aa13:
while(1){
portb=0b00000000;delay_ms(50);
portb=0b11111111;delay_ms(50);
if(portb.f7 == 1) goto aa;
x10=x10++;
if(x10==8)goto aa;
}
}
}
اكون شاكر
ا