{"id":12956,"date":"2021-04-09T15:13:42","date_gmt":"2021-04-09T19:13:42","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/?p=12956"},"modified":"2021-04-09T15:13:42","modified_gmt":"2021-04-09T19:13:42","slug":"mood-box","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/mood-box\/","title":{"rendered":"Mood Box"},"content":{"rendered":"<p class=\"p1\" style=\"text-align: center\">A box that can display a user\u2019s moods<\/p>\n<h3>Video<\/h3>\n<div id=\"attachment_12978\" style=\"width: 610px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12978\" loading=\"lazy\" class=\"size-full wp-image-12978\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/ezgif.com-gif-maker-19.gif\" alt=\"\" width=\"600\" height=\"338\" \/><p id=\"caption-attachment-12978\" class=\"wp-caption-text\">Overall demonstration of mood box.<\/p><\/div>\n<h3>Overall Photo<\/h3>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-12980\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2288-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<h3>Detail Photos<\/h3>\n<div id=\"attachment_12973\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12973\" loading=\"lazy\" class=\"size-full wp-image-12973\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2296-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12973\" class=\"wp-caption-text\">This is an inside view of the mood box. On the bottom is a bread board with LEDs, resistors, and buttons soldered onto it. Each LED corresponds to a button. This was mostly used as a debugging tool.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12974\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12974\" loading=\"lazy\" class=\"size-full wp-image-12974\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2298-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12974\" class=\"wp-caption-text\">The LED matrix is mounted on a mini bread board. This made wiring it in the box a lot easier.<\/p><\/div>\n<h3>Demonstration Images<\/h3>\n<div id=\"attachment_12976\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12976\" loading=\"lazy\" class=\"size-full wp-image-12976\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2293-1-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12976\" class=\"wp-caption-text\">You operate buttons to display different moods. There are five different moods (Anger, Sad, Neutral, Happy, Bored).<\/p><\/div>\n<div id=\"attachment_12977\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12977\" loading=\"lazy\" class=\"size-full wp-image-12977\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2292-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12977\" class=\"wp-caption-text\">The angry mood is triggered when left most button is pressed.<\/p><\/div>\n<p>&nbsp;<\/p>\n<h3>Process Images and Review<\/h3>\n<div id=\"attachment_12964\" style=\"width: 2398px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12964\" loading=\"lazy\" class=\"size-full wp-image-12964\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26.jpg\" alt=\"\" width=\"2388\" height=\"1668\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26.jpg 2388w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-300x210.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-1024x715.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-768x536.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-1536x1073.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-2048x1431.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-973x680.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled_Artwork-26-508x355.jpg 508w\" sizes=\"(max-width: 2388px) 100vw, 2388px\" \/><p id=\"caption-attachment-12964\" class=\"wp-caption-text\">Initial Ideation Sketches. I originally wanted to make more abstract animations, but it was difficult to convey emotion. As a result, I chose to use eyes.<\/p><\/div>\n<p>Around the time of ideation and creating the first prototype, I realized that I had to limit how ambitious I wanted to be with animations. I originally wanted multicolor matrix animations that were pretty visually complex, but it did not make sense in the context of expressing emotion. I chose to animate eyes because emotion expressed through eyes is more recognizable and the work load was more reasonable.<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-12956-1\" width=\"620\" height=\"1102\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2264.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2264.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2264.mp4<\/a><\/video><\/div>\n<div id=\"attachment_12959\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12959\" loading=\"lazy\" class=\"size-full wp-image-12959\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2265-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12959\" class=\"wp-caption-text\">Laser cut box with push buttons screwed in. This was the first time that I got to see and do laser cutting and it was super cool!<\/p><\/div>\n<div id=\"attachment_12960\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12960\" loading=\"lazy\" class=\"size-full wp-image-12960\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2275-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12960\" class=\"wp-caption-text\">This was when all the buttons, LEDs, and their resistors were properly soldered and working. I originally thought a bread board would be fine, but with so many buttons and loose connections, I ended up soldering everything. The LEDs were originally a debugging tool that helped me see if input from the buttons was working, but I ended up incorporating different color LEDs into the project.<\/p><\/div>\n<p>A big moment where I had to pivot was when I realized I had soldered my 16&#215;8 LED matrix incorrectly. I called a couple of hardware stores, but apparently desoldering tools are rarely in stock. Luckily I still had one working 8&#215;8 LED matrix and since all my animations were already 8&#215;8 bit maps, it wasn&#8217;t difficult to finish animating all the different moods. The current version of the project still has a gaping square for where the other eye should go, but that can be fixed in future version of the mood box.<\/p>\n<div id=\"attachment_12968\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-12968\" loading=\"lazy\" class=\"size-full wp-image-12968\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/IMG_2278-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12968\" class=\"wp-caption-text\">Finished version of the mood box (pirate eye edition). I soldered the 16&#215;8 LED matrix incorrectly, so I ended up only being able to implement the box with one eye.<\/p><\/div>\n<h3>Discussion<\/h3>\n<p>I received a lot of positive reactions from the animations. &#8220;The animation is super cool!! I love that you were able to convey emotion with just two frames for each emotion&#8221;. While most of the moods were just two frames, the &#8220;sad&#8221; mood was around 6 frames because I wanted to animate a tear. I really appreciate all the love the animations got I hope I can improve them in future versions of the box. I also received quite a bit feedback regarding user interaction. &#8220;The buttons could have labels or colors to differentiate them&#8221;. Currently, I&#8217;d say the weakest part of the project is the user interface. The buttons are all one color so it&#8217;s difficult to tell which mood is which, but I&#8217;d like to solve this issue with color coded buttons.<\/p>\n<p>There was mix of things that I loved and hated about the final product. Laser cutting the box and screwing in the buttons was a lot of fun and I like how compact the box is. I enjoyed soldering LEDs, resistors, and buttons and I believe that was one of my smarter decisions. While I do like the current animations, I know I could improve the way that I implemented the code and allow for more variation. Overall, I&#8217;m not happy with the current version, but I still love the idea of a mood box and I want to build off of what I have now.<\/p>\n<p>One of my biggest take aways is hardware is hard (pun intended). The majority of my issues were hardware issues and most of the time I did not even know that it was a hardware issue. When I was first prototyping with an 8&#215;8 LED matrix, I spent hours debugging example code when it was just the LED matrix that was broken. Near the end of this project, I ended up soldering my 16&#215;8 matrix wrong and when I realized it was a hardware issue, it was difficult to move past it. On a more positive note, I enjoyed laser cutting and I would love to have more opportunities to do it.<\/p>\n<p>In a new iteration of the box, I\u2019d fix the 16&#215;8 matrix so there would be two eyes. I\u2019d also want to color code the buttons to indicate different moods. I\u2019d also want to add some mechanism that can turn the box on and off.<\/p>\n<h3>Technical Information<\/h3>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-12971\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2.jpg\" alt=\"\" width=\"864\" height=\"1181\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2.jpg 864w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2-219x300.jpg 219w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2-749x1024.jpg 749w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2-768x1050.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/04\/Untitled-Diagram-2-508x694.jpg 508w\" sizes=\"(max-width: 864px) 100vw, 864px\" \/><\/p>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/*\r\n   60-223: Mood Box\r\n   Shuyu Zhang (shuyuzha)\r\n   \r\n   Description: This device reads 5 buttons as inputs, and\r\n   drives 5 and a LED Matrix as outputs. When the Red LED Button\r\n   is pressed, the Angry animation is triggered. The Blue LED Button\r\n   triggers the Sad Animation, the Whote LED Button triggers the Neutral\r\n   Animation, the Yellow LED Button triggers the Happy Animation,\r\n   and the Green LED Button triggers the Bored Animation. \r\n\r\n   Collaboration and sources:\r\n   1) I referenced the Adafruit LED Matrix code to make bitmaps and \r\n   load them onto the LED Matrix.\r\n   \r\n   https:\/\/github.com\/adafruit\/Adafruit_LED_Backpack\/blob\/master\/examples\/matrix8x8\/matrix8x8.ino\r\n\r\n\r\n   Pin mapping:\r\n\r\n   Arduino pin | type   | description\r\n   ------------|--------|-------------\r\n       4         Output    Red LED\r\n       5         Input     Red LED Button\r\n       6         Input     Blue LED Button\r\n       7         Output    Blue LED\r\n       8         Input     White LED Button\r\n       9         Output    White LED\r\n       10        Input     Yellow LED Button\r\n       11        Output    Yellow LED\r\n       12        Output    Green LED \r\n       13        Input     Green LED Button\r\n       SDA       Output    LED Matrix I2C backpack\r\n       SCL       Output    LED Matrix I2C backpack\r\n*\/\r\n\r\n#include &lt;Wire.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n#include \"Adafruit_LEDBackpack.h\"\r\n\r\nconst int DELAYONE = 1000;\r\nconst int REDLED = 4;\r\nconst int REDBUTTON = 5;\r\nconst int BLUELED = 7;\r\nconst int BLUEBUTTON = 6;\r\nconst int WHITELED = 9;\r\nconst int WHITEBUTTON = 8;\r\nconst int YELLOWLED = 11;\r\nconst int YELLOWBUTTON = 10;\r\nconst int GREENLED = 12;\r\nconst int GREENBUTTON = 13;\r\n\r\nconst int NUMLED = 5;\r\n\r\nAdafruit_8x16matrix matrix = Adafruit_8x16matrix();\r\n\r\nstatic const uint8_t PROGMEM\r\nsmile_bmp[] =\r\n{ B00111100,\r\n  B01000010,\r\n  B10100101,\r\n  B10000001,\r\n  B10100101,\r\n  B10011001,\r\n  B01000010,\r\n  B00111100\r\n},\r\nneutral_bmp[] =\r\n{ B00111100,\r\n  B01000010,\r\n  B10100101,\r\n  B10000001,\r\n  B10111101,\r\n  B10000001,\r\n  B01000010,\r\n  B00111100\r\n},\r\nfrown_bmp[] =\r\n{ B00111100,\r\n  B01000010,\r\n  B10100101,\r\n  B10000001,\r\n  B10011001,\r\n  B10100101,\r\n  B01000010,\r\n  B00111100\r\n},\r\nneutral_eye[] =\r\n{ B00000000,\r\n  B00111100,\r\n  B01111110,\r\n  B01110110,\r\n  B01100110,\r\n  B01111110,\r\n  B00111100,\r\n  B00000000\r\n},\r\nneutral_blink[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B00000000,\r\n  B01000000,\r\n  B01100000,\r\n  B01111110,\r\n  B00111100,\r\n  B00000000\r\n},\r\nsad_eye1[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100100,\r\n  B00011000,\r\n  B00000000,\r\n  B00000000,\r\n  B00000000\r\n},\r\nsad_eye2[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100110,\r\n  B00011000,\r\n  B00000000,\r\n  B00000000,\r\n  B00000000\r\n},\r\nsad_eye3[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100100,\r\n  B00011010,\r\n  B00000000,\r\n  B00000000,\r\n  B00000000\r\n},\r\nsad_eye4[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100100,\r\n  B00011000,\r\n  B00000010,\r\n  B00000000,\r\n  B00000000\r\n},\r\nsad_eye5[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100100,\r\n  B00011000,\r\n  B00000000,\r\n  B00000010,\r\n  B00000000\r\n},\r\nsad_eye6[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B01000010,\r\n  B00100100,\r\n  B00011000,\r\n  B00000000,\r\n  B00000000,\r\n  B00000010\r\n},\r\nbored_eye[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B00000000,\r\n  B01111110,\r\n  B01011010,\r\n  B00100100,\r\n  B00011000,\r\n  B00000000\r\n},\r\nbored_blink[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B00000000,\r\n  B00000000,\r\n  B01111110,\r\n  B00111100,\r\n  B00000000,\r\n  B00000000\r\n},\r\nhappy_eye[] =\r\n{ B00000000,\r\n  B00000000,\r\n  B00011000,\r\n  B00100100,\r\n  B01000010,\r\n  B00000000,\r\n  B00000000,\r\n  B00000000\r\n},\r\nhappy_blink[] =\r\n{ B00000000,\r\n  B00111100,\r\n  B01111110,\r\n  B01100110,\r\n  B01111110,\r\n  B00111100,\r\n  B00000000,\r\n  B00000000\r\n},\r\nangry_eye[] =\r\n{ B01110000,\r\n  B10001100,\r\n  B10000010,\r\n  B10010110,\r\n  B10011010,\r\n  B01000100,\r\n  B00111000,\r\n  B00000000\r\n},\r\nangry_blink[] =\r\n{ B00000000,\r\n  B10000000,\r\n  B11000000,\r\n  B11110010,\r\n  B11111110,\r\n  B00111100,\r\n  B00000000,\r\n  B00000000\r\n};\r\n\r\nint reading;\r\nint LEDs[] = {REDLED, BLUELED, WHITELED, YELLOWLED, GREENLED};\r\nint Buttons[] = {REDBUTTON, BLUEBUTTON, WHITEBUTTON, YELLOWBUTTON, GREENBUTTON};\r\nint lastState[] = {1, 1, 1, 1, 1};\r\nint butState[] = {1, 1, 1, 1, 1};\r\nint LEDState[] = {0, 0, 0, 0, 0};\r\nint faceState[] = {0, 0, 0, 0, 0};\r\nunsigned long lastDebounceTimes[] = {0, 0, 0, 0, 0};\r\n\r\nunsigned debounceDelay = 10;\r\nbool RedOn = false;\r\nbool BlueOn = false;\r\nbool AngryOn = false;\r\nbool NeutralOn = false;\r\nbool BoredOn = false;\r\nbool HappyOn = false;\r\n\r\nunsigned long neutralTimer = 0;\r\nunsigned long neutralTimer2 = 0;\r\n\r\nunsigned long sadTimer1 = 0;\r\nunsigned long sadTimer2 = 0;\r\nunsigned long sadTimer3 = 0;\r\nunsigned long sadTimer4 = 0;\r\nunsigned long sadTimer5 = 0;\r\nunsigned long sadTimer6 = 0;\r\nunsigned long sadTimer7 = 0;\r\n\r\nunsigned long angryTimer1 = 0;\r\nunsigned long angryTimer2 = 0;\r\n\r\nunsigned long happyTimer1 = 0;\r\nunsigned long happyTimer2 = 0;\r\n\r\nunsigned long boredTimer1 = 0;\r\nunsigned long boredTimer2 = 0;\r\n\r\nvoid neutralEye() {\r\n  if (millis() - neutralTimer &gt;= DELAYONE) {\r\n    neutralTimer = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, neutral_eye, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  } else if (millis() - neutralTimer2 &gt;= (DELAYONE * 3.5)) {\r\n    neutralTimer2 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, neutral_blink, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n}\r\n\r\n\r\nvoid sadEye() {\r\n\r\n  if (millis() - sadTimer1 &gt;= DELAYONE) {\r\n    sadTimer1 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye1, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  } else if (millis() - sadTimer2 &gt;= DELAYONE) {\r\n    sadTimer2 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye2, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  } else if (millis() - sadTimer3 &gt;= DELAYONE) {\r\n    sadTimer3 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye3, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  } else if (millis() - sadTimer4 &gt;= DELAYONE) {\r\n    sadTimer4 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye4, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  } else if (millis() - sadTimer5 &gt;= DELAYONE ) {\r\n    sadTimer5 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye5, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  } else if (millis() - sadTimer6 &gt;= DELAYONE) {\r\n    sadTimer6 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, sad_eye5, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n\r\n  }\r\n\r\n}\r\n\r\nvoid boredEye() {\r\n  if (millis() - boredTimer1 &gt;= DELAYONE) {\r\n    boredTimer1 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, bored_eye, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  } else if (millis() - boredTimer2 &gt;= (DELAYONE * 2)) {\r\n    boredTimer2 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, bored_blink, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n\r\n}\r\n\r\nvoid happyEye() {\r\n  if (millis() - happyTimer1 &gt;= DELAYONE) {\r\n    happyTimer1 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, happy_eye, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n  if (millis() - happyTimer2 &gt;= (DELAYONE * 2)) {\r\n    happyTimer2 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, happy_blink, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n\r\n}\r\n\r\nvoid angryEye() {\r\n\r\n  if (millis() - angryTimer1 &gt;= DELAYONE) {\r\n    angryTimer1 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, angry_eye, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n  angryTimer2 = angryTimer1;\r\n  if (millis() - angryTimer2 &gt;= (DELAYONE \/ 2)) {\r\n    angryTimer2 = millis();\r\n    matrix.clear();\r\n    matrix.drawBitmap(0, 0, angry_blink, 8, 8, LED_ON);\r\n    matrix.writeDisplay();\r\n  }\r\n\r\n}\r\n\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);\r\n  Serial.println(\"8x16 LED Matrix Test\");\r\n\r\n  pinMode(REDBUTTON, INPUT_PULLUP);\r\n  pinMode(REDLED, OUTPUT);\r\n\r\n  pinMode(BLUEBUTTON, INPUT_PULLUP);\r\n  pinMode(BLUELED, OUTPUT);\r\n\r\n\r\n  pinMode(WHITEBUTTON, INPUT_PULLUP);\r\n  pinMode(WHITELED, OUTPUT);\r\n\r\n\r\n  pinMode(YELLOWBUTTON, INPUT_PULLUP);\r\n  pinMode(YELLOWLED, OUTPUT);\r\n\r\n\r\n  pinMode(GREENBUTTON, INPUT_PULLUP);\r\n  pinMode(GREENLED, OUTPUT);\r\n\r\n  matrix.begin(0x70);  \/\/ pass in the address\r\n\r\n}\r\n\r\n\r\nvoid loop() {\r\n\r\n\r\n  Serial.println(butState[0]);\r\n\r\n  for (int i = 0; i &lt; NUMLED; i++) {\r\n    reading = digitalRead(Buttons[i]);\r\n\r\n    if (reading != lastState[i]) {\r\n      lastDebounceTimes[i] = millis();\r\n    }\r\n\r\n    if ((millis() - lastDebounceTimes[i] &gt; debounceDelay)) {\r\n      if (reading != butState[i]) {\r\n        butState[i] = reading;\r\n\r\n        if (butState[i] == LOW) {\r\n\r\n          if (i == 0) {\r\n            RedOn = true;\r\n            BlueOn = false;\r\n            NeutralOn  = false;\r\n            BoredOn = false;\r\n            HappyOn = false;\r\n          } else if (i == 1) {\r\n            BlueOn = true;\r\n            RedOn = false;\r\n            NeutralOn = false;\r\n            BoredOn = false;\r\n            HappyOn = false;\r\n          } else if (i == 2) {\r\n            NeutralOn = true;\r\n            BlueOn = false;\r\n            RedOn = false;\r\n            BoredOn = false;\r\n            HappyOn = false;\r\n          } else if (i == 3) {\r\n            HappyOn = true;\r\n            RedOn = false;\r\n            BlueOn = false;\r\n            NeutralOn = false;\r\n            BoredOn = false;\r\n          } else if (i == 4) {\r\n            BoredOn = true;\r\n            RedOn = false;\r\n            BlueOn = false;\r\n            NeutralOn = false;\r\n            HappyOn = false;\r\n\r\n          }\r\n\r\n\r\n          LEDState[i] = HIGH;\r\n          faceState[i] = 1;\r\n          for (int j = 0; j &lt; NUMLED; j++) {\r\n            if (j != i) {\r\n              LEDState[j] = LOW;\r\n              faceState[j] = 0;\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\n    for (int k = 0; k &lt; NUMLED; k ++) {\r\n      digitalWrite(LEDs[k], LEDState[k]);\r\n    }\r\n\r\n\r\n    if (RedOn) {\r\n      angryEye();\r\n    } else if (BlueOn) {\r\n      sadEye();\r\n    } else if (NeutralOn) {\r\n      neutralEye();\r\n    } else if (BoredOn) {\r\n      boredEye();\r\n    } else if (HappyOn) {\r\n      happyEye();\r\n    } else {\r\n      neutralEye();\r\n    }\r\n\r\n    lastState[i] = reading;\r\n\r\n  }\r\n\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A box that can display a user\u2019s moods Video Overall Photo Detail Photos &nbsp; Demonstration Images &nbsp; Process Images and Review Around the time of ideation and creating&#8230;<\/p>\n","protected":false},"author":181,"featured_media":12975,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[89],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts\/12956"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/users\/181"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/comments?post=12956"}],"version-history":[{"count":12,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts\/12956\/revisions"}],"predecessor-version":[{"id":13088,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts\/12956\/revisions\/13088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/media\/12975"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/media?parent=12956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/categories?post=12956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/tags?post=12956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}