Sleep and Wake Arduino according to LDR interrupt I have to sleep the system in the night and have to wake the system in day time. I am using LDR to get input. LDR input is connected to interrupt pin 0 of Arduino Uno. 

Here is my code.

#include &lt;avr/sleep.h&gt;
int led =13;
int triggerPin = 2;

void wakeUpNow() 
{

}

void setup()
{
pinMode(triggerPin, INPUT);
pinMode(led, OUTPUT);
attachInterrupt(0, sleepNow, LOW); 
}

void loop()
{
digitalWrite(led, HIGH);;
delay(1000);
digitalWrite(led, LOW);
}

void sleepNow() 
{
set_sleep_mode(SLEEP_MODE_PWR_DOWN); 
sleep_enable(); 
attachInterrupt(0,wakeUpNow, RISING); 
sleep_mode(); 
sleep_disable();
detachInterrupt(0); 
}


Cannot we attach two function in a interrupt? 

Edited
The following code works perfectly. I want to replace the conditional check with interrupt.

#include &lt;avr/sleep.h&gt;
int led =13;
int wakePin = 2; 

void wakeUpNow() 
{
delay(100);
}

void setup()
{
pinMode(wakePin, INPUT);
pinMode(led, OUTPUT);
//attachInterrupt(0, sleepNow, LOW); 
}

void loop()
{
digitalWrite(led, HIGH);;
delay(1000);
digitalWrite(led, LOW);

if(digitalRead(wakePin)==LOW)
  sleepNow(); 

}

void sleepNow() 
{
set_sleep_mode(SLEEP_MODE_PWR_DOWN); 
sleep_enable(); 
attachInterrupt(0,wakeUpNow, RISING); function
sleep_mode(); 
sleep_disable(); 
detachInterrupt(0);
}


I want to replace `

if(digitalRead(wakePin)==LOW)
  sleepNow()


with`

attachInterrupt(0, sleepNow, LOW);


Please let me know how I can do that.

Thank you.
I want to replace the conditional check with interrupt.


Why? If it is awake it might just as well be testing the pin as doing anything else.

If you make it an interrupt, in the ISR interrupts will be off. Then if you go to sleep it will never wake.

So, your current design is the correct one, except:

attachInterrupt(0,wakeUpNow, RISING); function


What is function doing there?