I'm trying out the low power library at: http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/
and have my 328P staying in deep sleep until a button is pressed where I would like it to turn on an LED and keep it on until I press the same button and then it goes back into deep sleep. Right now the toggle part of it isn't working. It just lights up while the button is press. Any help would be great since i'm no good at programming.
// Use pin 2 as wake up pin
const int wakeUpPin = 2;
int led = 13;
volatile int state = LOW;
// Configure wake up pin as input.
// Allow wake up pin to trigger interrupt on high.
attachInterrupt(0, toggle, HIGH); //note the High on my design
// Enter power down state with ADC and BOD module disabled.
// Wake up when wake up pin is high.
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
// Disable external pin interrupt on wake up pin removed for it to work
if(state == LOW)
state = HIGH;
state = LOW;