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,