pic 12F629 i need Help

General discussion on mikroC.
Post Reply
Author
Message
sasait
Posts: 1
Joined: 23 May 2005 11:46

pic 12F629 i need Help

#1 Post by sasait » 02 Jun 2005 15:01

:cry: Hello.i work with Pic 12F629 i don't understand why my program don't work because the compilation is ok and all functions work independantely. I post you my program if you know what the errors i thank you in advance. // pic 12F629 i use this pic to programming acamera[ONN/OFF]

Code: Select all

void main() {
  char First=0;
  char Flp=0;
  char Fln=0;
  GPIO = 0xFF;
  TRISIO=0XF3;

   do {
     Flp = (!First) & ( GPIO) ;
     Fln = ( First) & (!GPIO) ;

     if(Flp&0X01) {
        GPIO|=0X02;
        delay_ms(2000);
        GPIO&=0XFD;
        delay_ms(2000);
        GPIO&=0XFB;
        delay_ms(2000);
        GPIO|=0X04;
        }
     else if(Fln&0X01) {
        GPIO&= 0XFB;
        delay_ms(2000);
        GPIO|=0X04;
        delay_ms(2000);
        GPIO|=0X02;
        delay_ms(2000);
        GPIO&=0XFD;
        }

    First = GPIO;



     }  while(1) ;

}

Post Reply

Return to “mikroC General”