How do you wake a 1284p Arduino with Pin Change interupt?

Hi all,

How do you go about waking a Moteino Mega from sleep on a pin change interupt? I’ve got a momentary push button that is connected to Digital pin 3, and it goes low when pressed. It it held high when not pressed by a 10k resistor.

I’ve also mastered getting my moteino mega to sleep using the lowpower library, but I can’t work out how to make it wakeup when the button is pressed.

I’ve searched for hours but I can’t find anything that doesn’t end with either no answer or someone saying they’re doing it wrong.

Here’s my non working code that I borrowed from here and tried to modify it:

#include "LowPower.h"
#include <PinChangeInt.h>
 

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 3;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

void WakeHandler()
{
  // Nothing to do; just wakes the device. 
}

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  Serial.begin(9600);
  Serial.print("begin");
 }

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
     Serial.print("high");
     
    
  } else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
     Serial.println("Low");
     delay(500);
     Serial.flush();
    PCintPort::attachInterrupt(buttonPin, &WakeHandler, LOW);
     LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); 
     PCintPort::detachInterrupt(buttonPin);
     Serial.print("I woke");
  }
}

void burpcount()
{
  Serial.println("d");
}

What am I doing wrong?