Intention
I made this device for my roommate, Sonam, so she never has to come home to a dark house again.
This is a basic breadboard circuit configuration with a hall effect US5881 sensor that turns on an LED light. The code is programmed to turn on the LED when it senses a magnet nearby. The application of this in real life is, for example, a simulation of a magnetized key turning on the lights when the door is unlocked.
The code is programmed to keep the light on even when the magnet is removed. At first, my if else statement was turning it off when the magnet was removed. The fix was frustratingly simple! By deleting the else, the loop stopped after turnOnLED(); and the light remained in the on state. (See code below).
A three prong, one sided switch was added to be able to turn off the light.
I didn't push myself as far technically as I could have for this project, but I still invested a lot of time. Rather than rush myself to finish it, I spent a lot of time watching tutorials, reading blogs, and understanding the sensors and code I was working with. The code I used was really easy to understand and applied to my project almost perfectly, but it gave me a chance to play with each line of code and really understand what was happening.
I tried working with the the NeoPixel RBGW Ring that I have, but couldn't figure it out given the deadline. I'm not giving up and I know we have course resources that could help me. Hopefully for my next project I'll be able to get them to work.
I also started to become more familiar with some of the help sites. For example, I didn't realize adafruit had a learning center: https://learn.adafruit.com/adafruit-neopixel-uberguide/neopixel-rings
I was able to send a message using ifttt.com but wasn't able to get the loop to stop firing, so I've since commented that feature out. So far the only solution classmates have found to stop the sudden barrage of sms messages is to add a really long delay in the loop (see below). The issue with this is that stops the code and makes the device unresponsive for whatever period of time you have set.
Code credit: http://integratedinnovation.xsead.cmu.edu/gallery/projects/turn-down-for-what
You can upload files of up to 20MB using this form.