Setting the port for the infra-red

11 views
Skip to first unread message

Henri Aghaei

unread,
Apr 8, 2014, 10:34:52 AM4/8/14
to ti-lau...@googlegroups.com
I have the following code for MSP430f47197 and works for the Yellow LED. But for the infra-red clear LED does not! Should I set another pin to make it work?



#include <msp430f47197.h>
int main ( void ) 

   
   
   
   
   WDTCTL = WDTPW + WDTHOLD; // Stop WDT 
 
 while(1)
 {
 
 P5DIR |= 0x40; // P5.4 output 
 P5OUT ^= 0x40;
 
 
 
 __delay_cycles(10000);
 P5DIR |= 0X00;
  P5OUT ^= 0x00;
   __delay_cycles(10000);
 }
  

}




------Infra:


#include <msp430f47197.h>

int main ( void ) 

 
   
   WDTCTL = WDTPW + WDTHOLD; // Stop WDT 
 
    while(1)
    {
 
 P1DIR |= 0x01; 

 
 
 
 __delay_cycles(10000);
 P1DIR |= 0X00;

   __delay_cycles(10000);
    }
  

}

Reply all
Reply to author
Forward
0 new messages