Alarm Project and learning curves

Basically, I built an alarm which lights up and plays music. Here’s my code. At first I wanted to use a potentiometer to set age as a parameter for the length of the alarm time. Different ages need different sleep. I’m interested in augmenting sleep hygiene. I wonder, should we be in total control of our sleep timing? Considering the unhealthy sleep patterns of many modern people, I wonder.  The thought of connected and augmented sleep ties into my midterm idea. I did some sketches/notes, see below.REM-sleep-cycleFullSizeRender

All good and fine in theory. Then it falls apart.

giphy-1

Let the hurdles begin: First, the potentiometer is problematic to use with javascript, as it is best with digital, so I reevaluated my functionality. I set up a ball switch for the circuit to turn off the alarm. Then, low and behold the npm library which I had chosen was pulling up a ‘window’ error- it wasn’t playing well with rPi. Ugh. Reboot!

IMG_8066Screen Shot 2015-09-24 at 5.08.35 PM
My second time around I set up the node-aplay library. And it worked! Kind of. The file plays as static. 😦 I tested it on ‘omxplayer music.mp3’ and the file works. I’m stumped! Have to run this by Ayo in class.

On the bright side, I’ve learned a massive amount about how the libraries function! I’ve now played audio on my Pi and used Cyberduck to send a file and edit code on my PI! And my alarm code/pcomp does work!

ps! i forgot that we were doing wordpress for the blog so i posted on tumblr. oops!

Alarm Project and learning curves

Leave a comment