printf("\n\rGoing to SLEEP........"); //transmit a message over the EUSART to notify that the MCU is about to go to SLEEP SLEEP(); //Place the MCU into low power SLEEP /////////////////this code will only execute once the MCU is woken from SLEEP//////////////////////////////////////////// __delay_ms(50); //Wait 50 ms printf("\n\rAwake!! "); //transmit a message over the EUSART that the MCU is now awake __delay_ms(500); //wait 500 ms before looping and repeating the above