In this code I wrote in different style,I wrote it from downside to upside ,I had 3 Functions (1-SleepingMode1())-(2-SleepingMode2())-(3-WakingMode()) ,I wrote the third at first , then the second then the first

SleepingMode1: if the Baby starts crying the arduino starts playing some quiet Music

SleepingMode2: if the baby didn't stop crying the arduino continue playing the quiet music

In all these functions arduino send to the parents message on the twitter to inform them any updates