Eye Mask Sleeping Music

by archerlin in Circuits > Tools

286 Views, 0 Favorites, 0 Comments

Eye Mask Sleeping Music

1388367962-1248645195.jpg

This is a project let you sleep better at night, rely on the slow version Christmas song on the eye mask.

Prepare Materials

download.jpg

Materials

1. Arduino Leonardo

2. Electronic Material Horn

3. Eye mask (the one you prefer the most)

Build Up

ED9BDE45-8EC3-41EA-9E8F-4472AA3B1CB9.JPG

Build up your Arduino Leonardo Board

Put the Electronic Material Horn directly on the place I drew

(Make sure it won't move around)

Time for Program

16498612-6D44-41D5-AA31-D0A33EC6EB33.JPG

This is the time for program, open your "Arduino" on your laptop and directly copy the program down here.

int buzzerPin = 13;
int tempo = 200; char notes[] = "eeeeeeegcde fffffeeeeddedg"; int duration[] = {1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2};

void playTheShit(char note, int duration) { char notesName[] = { 'c', 'd', 'e', 'f', 'g' }; int tones[] = { 261, 293, 329, 349, 392 };

for (int i = 0; i < sizeof(tones); i++) { // Bind the note took from the char array to the array notesName if (note == notesName[i]) { // Bind the notesName to tones tone(buzzerPin, tones[i], duration); } } }

void setup() { pinMode(buzzerPin, OUTPUT); }

void loop() { // Scan each char from "notes" for (int i = 0; i <= sizeof(notes)-1; i++) { if (notes[i] == ' ') { // If find a space it rests delay(duration[i] * tempo); } else { playTheShit(notes[i], duration[i] * tempo); }

// Pauses between notes delay((tempo*2)*duration[i]); } }

Plug

download-1.jpg

Plug the battery to your Arduino board

Make sure the program works

If it doesn't, just comment

Make Your Eye Mask

il_340x270.953946382_dhfs.jpg

Stick the horn on your eye mask

Put it on, and sleep

Write on your name before others steal.