This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

_delay_cycles

Other Parts Discussed in Thread: MSP430G2231

This code blinks only red LED.

#include <msp430g2231.h> 

 

void main()

{

P1DIR = 0x41;

P1OUT = 0;

while(1)

{

P1OUT = 0x01;                // P1.6 on (green LED)

   _delay_cycles(30000);

P1OUT = 0x00;

   _delay_cycles(30000);

   P1OUT = 0x40;

   _delay_cycles(30000);

  

  

}

}

This code blinks both LED
#include <msp430g2231.h> 
void main()
{
P1DIR = 0x41;
P1OUT = 0;
while(1)
{
P1OUT = 0x01;                // P1.6 on (green LED)
   _delay_cycles(10000);
P1OUT = 0x00;
   _delay_cycles(10000);
   P1OUT = 0x40;
   _delay_cycles(10000);
  
  
}
}

**Attention** This is a public forum