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

Simple LPM4 serial demo ... does not work

$
0
0

Hello,

 

The µc shall sleep all the time, unless the button is pressed, then there should be an output on the serial console. After that i want to let him sleep again.

But it doesn't work.. why?

Can you help me?

 

The Output is:

 

..running!

before

after

before

after

before

after

before

after

before

after

before

after

.

.

.

an pressing the button takes no effect

void setup() 
{
Serial.begin(9600);
delay(3000);
Serial.println("..running!");
Serial.println();

pinMode(P1_3, INPUT_PULLUP); 
attachInterrupt(P1_3, awake, FALLING);
  
} 



void loop() 
{
 Serial.println("before");
 LPM4;  // start in ultra low power mode, all work is done in the ISR routines
 Serial.println("after");
}

void awake(void)
{
  
  delay(100);
  Serial.println();
  Serial.println("Awake!");
  
}

i've used a fresh install of energia 0101e00013


Viewing all articles
Browse latest Browse all 2077

Trending Articles