Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Declaration expected (http://www.go4expert.com/forums/declaration-expected-t9271/)

Stino31 12Mar2008 14:43

Declaration expected
 
Hi guys,

Ive got an error with this code. The error says ''Expected declaration''.
Code:

//
//
//
//
#include "msp430x20x1.h"

void main(void);

{
  WDTCTL = WDTPW + WDTHOLD;                // Stop WDT
  P1DIR=0x7F;                              // P1.0 t/m P1.6 OUTPUT

 
  while(1);
  {
  if((P1IN&0x08)==0x08);
      {
    P1OUT=0x7F;
  }
 
  else
  {
    P1OUT=0x01;
  }
  return 0;
  }
}

Thanks in advance!

asadullah.ansari 12Mar2008 14:51

Re: Declaration expected
 
First in your program there is Infinite loop

Stino31 12Mar2008 15:03

Re: Declaration expected
 
I wanna realize when P1IN = 0x07 al output pins 0x7F get high.
I'm just started with C so i'm a complete beginner.

What do you mean with that infite loop?


All times are GMT +5.5. The time now is 21:23.