Declaration expected

Stino31's Avatar, Join Date: Mar 2008
Newbie Member
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!
0
asadullah.ansari's Avatar, Join Date: Jan 2008
TechCake
First in your program there is Infinite loop
0
Stino31's Avatar, Join Date: Mar 2008
Newbie Member
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?