Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Energia ide + msp430f5529lp + low power mode.

$
0
0

Hi all,

I want to use the "low power mode" function in my project but it doesn't work properly. My Platform of development is Energia IDE.

I would put the msp430f5529lp in "low power mode" and leave it with the push2 button.

 

 

#include <Energia.h>
#include <msp430f5529.h>

 

volatile int state = HIGH;
volatile int flag = HIGH;
int count = 0;

void setup()
{
  Serial.begin(9600);

interrupts();

  pinMode(GREEN_LED, OUTPUT);
  digitalWrite(GREEN_LED, state);

  /* Enable internal pullup.
   * Without the pin will float and the example will not work */
  pinMode(PUSH2, INPUT_PULLUP);
  attachInterrupt(PUSH2, interrupt, FALLING); // Interrupt is fired whenever button is pressed

}

void loop()
{
  digitalWrite(GREEN_LED, state); //LED starts ON
  if(flag)

   {
    count++;
    Serial.println(count);
    flag = LOW;
   }
 _BIS_SR(LPM3_bits);
}

void interrupt()
{
  state = !state;
  flag = HIGH; 
}

 

 

 

That's fine compile but don't work.  

 

Why ?

WHere is the problem ?

 

Thank you,


Viewing all articles
Browse latest Browse all 2077

Trending Articles