Disable Sleep By Light Levels

The idea is simple… a basic circuit consisting of an LED on pin 13 for blinking, and your standard photoresistor to measure light levels. What I want to do is to power down the ATMega328P chip when the light level falls below a defined threshold, then have the sleep mode disabled when the light levels exceed that threshold. See attached code below, and my questions are as follows:

  1. Would this qualify as a pin change interrupt or an external interrupt?
  2. Is ISR() needed?
  3. I could use some guidance in how to define this interrupt, be it vector 2 or 4. I haven’t seen any code examples from which I can even form a starting point

Thanks!
Tom

#include <avr/sleep.h>
#include <avr/interrupt.h>

const int ldrPin = 0;
const int ledPin = 13;
const int Threshold = 400; // based on 4700 ohm pulldown resistor

ISR (INT0_vect)  // unsure if this is needed in final solution
{  
}

void setup()
{
  pinMode(ledPin, OUTPUT);
  // insert code here to define an interrupt that will break the sleep mode when LDR input exceeds threshold.
  // from ATMega328 datasheet, section 9.4, would a light sensor reading be an external interrupt or a pin change interrupt?
  //
  // VectorNo.   Program address     Source     Interrupt Definition
  //    2               0x0002               INT0       External Interrupt Request 1
  //    4               0x0006               PCINT0    Pin Change Interrupt Request 0
}

void loop()
{  
  sei(); // enable all interrupts
  
  int LightLvl = analogRead(ldrPin);  // test the light level
  if (LightLvl >= Threshold)  // do a simple blink routine
  {
    sleep_disable();
    digitalWrite(ledPin, HIGH);
    FakeDelay(LightLvl);
    digitalWrite(ledPin, LOW);
    IdleChip(LightLvl);
  }
  else if (LightLvl < Threshold) // too dark, so power down
  {
    digitalWrite(ledPin, LOW);
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);
    sleep_enable();
    sleep_mode();
  }
}

void IdleChip(unsigned long duration)  // apply delay and put ATMega328P in idle sleep mode
{
  unsigned long start = millis();
  set_sleep_mode(SLEEP_MODE_IDLE);  // choose idle mode for the chip
  sleep_enable();                              // this puts the chip into sleep mode, but doesn't command it to sleep yet
  digitalWrite(13, LOW);  // turn LED off to indicate sleep
  while (millis() - start <= duration) {
    sleep_mode();  // put chip in idle mode
  }
  sleep_disable();
  digitalWrite(13, HIGH); // turn LED on to indicate waking up
}

void FakeDelay(unsigned long duration)  // delay without engaging a chip sleep mode
{
  unsigned long start = millis();
  while(millis() - start <= duration) {
  }
}

This helped me http://www.gammon.com.au/forum/?id=11497

[u]Awesome[/u] link. I wish I'd seen that about two weeks ago!!!