Sparki the snooze alarm

Hey everyone

So you know that time in the morning when you switch off your alarm or hit snooze and lie in bed staring at the ceiling, staring at your smartphone or dozing back to sleep? Well Sparki can now be my snooze alarm.

For those ten minutes Sparki will move slightly disturbing me from falling back to sleep, and once those ten minutes are up, Sparki will play an annoying tune, guaranteed to get me out of bed!

He’ll also wish me a nice day!

#include <Sparki.h> // include the sparki library

void setup() {
 sparki.RGB(RGB_OFF);
 sparki.servo(60);
}
void loop()
{
 
 for (int i = 0; i < 6; i=i+1)
 {
 delay (100000);
 sparki.moveLeft(30);
 sparki.moveRight(30);
 }
 sparki.clearLCD();
 sparki.drawString(10,2, "Good morning Ash");
 sparki.updateLCD();
 delay (3000);
 int left = sparki.lightLeft();
 int right = sparki.lightRight();
 if (left>=right)
 {
 for (int i = 0; i < 6; i=i+1)
 {sparki.beep(740, 600);
 delay(400);
 sparki.beep(540, 400);
 delay(400);
 sparki.beep(540, 200);
 delay(200);
 sparki.beep(440, 200);
 delay(200);
 sparki.beep(640, 400);
 delay(400);
 sparki.beep(740, 200);
 delay(400);
 sparki.beep(740, 200);
 }}
 sparki.clearLCD();
 sparki.drawString(10,2, "Hope you have a good day");
 sparki.updateLCD();
 delay (3000);
 sparki.clearLCD();
 sparki.drawString(10,2, "ha en fin dag");
 sparki.updateLCD();
 delay (3000);
}

Let me know what you think….there are loads of ideas I have for this code 🙂

13138730_10208751226474608_3515831574067619993_n

 

Advertisements

2 thoughts on “Sparki the snooze alarm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s