Goal: Write an application that interfaces with an input and/or output device that you made
I am planning to incorporate motion activated lighting into my interactive doll house. I wanted to experiment with the motion sensor, which I had not previously tested in input and output devices week. I designed the board in eagle incorporating an LED and resistor, but did not end up finding lab hours that aligned with my schedule after Thanksgiving break. Therefore, I prototyped the setup with my arduino kit.
I updated my arduino code, which began with lighting up a red LED as long as motion was detecting in front of the PIR sensor, by using Serial.write to send '1' hours for motion and '0' for no motion.
In html, these values were requested through websocket and used to update the webpage. When a '0' was received, a black box with the word no next to it was displayed. When '1' was received, an orange box with 'Yes!' was displayed.
My biggest challenges in incorporating this were making sure that serial was actually sending the values or interest and creating an if statement in HTML to change the colors of the boxes. After figuring this out everything worked out.
are shown below.