1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Declaration expected

Discussion in 'C' started by Stino31, Mar 12, 2008.

  1. Stino31

    Stino31 New Member

    Joined:
    Mar 12, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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!
     
  2. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    First in your program there is Infinite loop
     
  3. Stino31

    Stino31 New Member

    Joined:
    Mar 12, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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?
     

Share This Page